running a script (not a daemon) at boot under systemctl
Hi, all -- I'm still a bit hung up on systemd :-( I've created a simple unit file diskfarm:~ # cat /etc/systemd/system/disks-timeout-set.service [Unit] Description=Set disk timeouts if needed [Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/local/sbin/disks-timeout-set.sh [Install] WantedBy=multi-user,target which calls the script, which runs and exits. The script runs happily, and I can even systemctl start it with apparent success. I've tried to enable it diskfarm:~ # systemctl enable disks-timeout-set.service Failed to enable unit: Invalid argument without any luck, though. 1) A service is really what I want for a simple run-and-exit script, right? No other unit type makes sense. 2) So what's the error and how do I debug? I've surfed like crazy, but everything presumes a daemon and all of the "enable" examples always succeed :-) TIA & HANN :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt
On 28.03.2021 06:16, David T-G wrote:
Hi, all --
I'm still a bit hung up on systemd :-( I've created a simple unit file
diskfarm:~ # cat /etc/systemd/system/disks-timeout-set.service [Unit] Description=Set disk timeouts if needed
[Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/local/sbin/disks-timeout-set.sh
[Install] WantedBy=multi-user,target
It should be full stop, not comma here.
which calls the script, which runs and exits. The script runs happily, and I can even
systemctl start
it with apparent success. I've tried to enable it
diskfarm:~ # systemctl enable disks-timeout-set.service Failed to enable unit: Invalid argument
without any luck, though.
1) A service is really what I want for a simple run-and-exit script, right? No other unit type makes sense.
2) So what's the error and how do I debug? I've surfed like crazy, but everything presumes a daemon and all of the "enable" examples always succeed :-)
TIA & HANN
:-D
Andrei, et al -- ...and then Andrei Borzenkov said... % % On 28.03.2021 06:16, David T-G wrote: % > % > I'm still a bit hung up on systemd :-( I've created a simple unit file ... % > % > [Install] % > WantedBy=multi-user,target % % It should be full stop, not comma here. Ah! Yeah, that would do it. By now I can almost understand what it's saying there, too :-) % ... % > it with apparent success. I've tried to enable it % > % > diskfarm:~ # systemctl enable disks-timeout-set.service % > Failed to enable unit: Invalid argument [snip] It works now :-) Thanks! HANN :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt
participants (2)
-
Andrei Borzenkov
-
David T-G