[systemd-devel] Unexplainable delays in execution of parted and sfdisk
Igor Plyatov
plyatov at gmail.com
Thu Dec 5 12:08:00 UTC 2019
Dear all,
I have my own /usr/bin/card_checker.sh shell script (Card Checker),
which check correctness of /dev/sda disk partitioning and make
re-partitioning when required.
Main commands of interest, executed by script are:
 parted -s /dev/sda rm 1            # Remove partition 1.
 echo -e ",1024M,83\n,,83" | sfdisk --quiet /dev/sda   # Create 2
Linux partitions.
Script unmount /dev/sda* to be sure disk is not busy before parted and
sfdisk execution.
Script operate flawless when started from console by hands. But same
script has very long (around 10 minutes) execution of parted and sfdisk
commands when called from systemd. With help of "ps ax" command I see
that parted or sfdisk stay running and do nothing for a while. They wake
up and do normal execution only after around 10 minutes.
The Card Checker Service file is as below:
[Unit]
Description=Card Checker Service
After=network.target
Before=gsiafw-console.service gsiafw.service gsieventmond.service
gsiauxpower.service gsilcdpaneld.service guinevere.service
[Service]
Type=oneshot
ExecStart=/usr/bin/card_checker.sh sda
StandardOutput=tty
StandardError=tty
[Install]
WantedBy=multi-user.target
Please, help to understand what need to be additionally configured in
that service file to allow normal (fast) execution of parted and sfdisk.
Best wishes.
--
Igor Plyatov
More information about the systemd-devel
mailing list