systemd unit does not load at startup. manual start shows no such file/dir failure
On Debian Jessie.
systemd unit does not load at startup. attempting to manually start the service results in: Code:
# systemctl start STAFProc Code:
# ls /usr/lib/systemd/system/ Code:
# systemctl daemon-reload The unit file: Code:
[Unit] P.S. The machine is set up to automatically log in as a (non-privileged) user in graphical mode. |
Sounds similar to a dependency requirement not specified...
Very likely it will need an After (or Wants, or maybe Requires - as in "Requires=local-fs.target") entry related to the filesystem. Assuming the filesystem is local maybe the "Requires=local-fs.target" would work. If it is NFS then "Requires=remote-fs.target" might do it. |
Quote:
|
As a workaround, removing the symbolic link from /etc/systemd/system/graphical.target.wants/ and copying the actual service file from /usr/lib/systemd/system/ worked. Not sure why the workaround should be necessary considering the other service (accounts-daemon) is up and running and is a symbolic link to the actual file. Any suggestions on how to get the service running using the symbolic links that systemctl (re)enable uses?
|
There's some pieces missing from your original post which may or may not help:
- with what commands did you install and enable STAFProc.service? - what does 'stat /usr/lib/systemd/system/STAFProc.service /usr/local/staf/STAFEnv.sh /usr/local/staf/startSTAFProc.sh' return? - when 'systemctl start STAFProc' does not start, what are all the lines systemctl returns? (Same for using the "status" argument.) - when 'systemctl start STAFProc' does not start, what are all the lines 'journalctl -xn' returns with respect to this service? - are there any related lines in /var/log/{messages,secure} or any other log file? - since /usr/local/staf/startSTAFProc.sh sources /usr/local/staf/STAFEnv.sh always, does incorporating that into /usr/local/staf/startSTAFProc.sh help? Finally, please describe in detail what startSTAFProc.sh and STAFEnv.sh do or just list (or attach) their full contents if unsure. |
There's some pieces missing from your original post which may or may not help:
|
Thanks. So there's: 0) uncertaintly if /usr is mounted when this service runs, 1) some error terminating STAX right as it starts, and 2) a "Cannot add dependency job for unit" error. #0 could be fixed by not using a separate /usr (or somehow ensuring it gets mounted before any service runs? Don't ask me.), #1 I don't know the cause and #2 could be countered adding some "Wants=" and "After=" stanzas to the service file to ensure Systemd gets your dependency ordering. Also what happens if you fill in the env vars and run Execstart like this?:
Code:
ExecStart=/bin/sh -c '/usr/bin/env VAR=VAL VAR=VAL VAR=VAL VAR=VAL /usr/bin/nohup /usr/local/staf/bin/STAFProc &' |
Hi I got it running after reinstalling the OS without the separate /usr (0). (1) is no longer a problem. And (2) I tried messing with Wants and Afters (before the reinstall, without any luck).
Instead of Code:
ExecStart=/bin/sh -c '/usr/bin/env VAR=VAL VAR=VAL VAR=VAL VAR=VAL /usr/bin/nohup /usr/local/staf/bin/STAFProc &' Code:
ExecStart=/bin/sh -c 'export VAR=VAL; COMMAND...' Anyway, aside from not having the separate /usr, I moved the unit file to /etc/systemd/system (where "local" unit files are supposed to go anyway; /usr/lib/systemd/system is for unit files from "installed packages"). Given the workaround (removing the symbolic link from /etc/systemd/system/graphical.target.wants/ and copying the actual service file from /usr/lib/systemd/system/), I'd guess that this was the correct fix. Thanks jpollard and unSpawn for your help. |
Quote:
|
Documentation indicates that more than one may be specified. Only one target is activated at boot (in my case graphical.target is the default) and the corresponding target.wants are run.
|
All times are GMT -5. The time now is 03:39 PM. |