It does not really answer the question. Those are valid options but are optional. Adding them to atd.service ExecStart will should not fix atd start. What is required is either Type=forking or RemainAfterExit=true and that was missing in description. To illustrate:
Nov 25 10:33:44 opensuse.site systemd[1]: Enqueued job atd.service/start as 2490
Nov 25 10:33:44 opensuse.site systemd[1]: About to execute: /usr/sbin/atd -l 0.8 -b 60
Nov 25 10:33:44 opensuse.site systemd[1]: Forked /usr/sbin/atd as 7905
Nov 25 10:33:44 opensuse.site systemd[1]: atd.service changed dead -> running
Nov 25 10:33:44 opensuse.site systemd[1]: Job atd.service/start finished, result=done
Nov 25 10:33:44 opensuse.site systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.GetUnit() on /org/freedesktop/systemd1
Nov 25 10:33:44 opensuse.site systemd[1]: Got D-Bus request: org.freedesktop.DBus.Properties.Get() on /org/freedesktop/systemd1/unit/atd_2eservice
Nov 25 10:33:44 opensuse.site systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
Nov 25 10:33:44 opensuse.site systemd[1]: Received SIGCHLD from PID 7905 (atd).
Nov 25 10:33:44 opensuse.site systemd[1]: Got SIGCHLD for process 7905 (atd)
Nov 25 10:33:44 opensuse.site systemd[1]: Child 7905 died (code=exited, status=0/SUCCESS)
Nov 25 10:33:44 opensuse.site systemd[1]: Child 7905 belongs to atd.service
Nov 25 10:33:44 opensuse.site systemd[1]: atd.service: main process exited, code=exited, status=0
Nov 25 10:33:44 opensuse.site systemd[1]: atd.service changed running -> stop-sigterm
and a bit later
bor@opensuse:~> sudo systemctl status atd.service
atd.service - Execution Queue Daemon
Loaded: loaded (/etc/systemd/system/atd.service; disabled)
Active: failed (Result: timeout) since Sun, 25 Nov 2012 10:35:14 +0400; 13s ago
Process: 7905 ExecStart=/usr/sbin/atd -l 0.8 -b 60 (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/atd.service
Adding either Type=forking (which is the real and correct fix, because that is what atd does) will enable systemd to correct recognize that service is started and what is the main PID of service:
bor@opensuse:~> systemctl --no-pager show atd.service -p ExecStart -p RemainAfterExit -p Type
Type=forking
ExecStart={ path=/usr/sbin/atd ; argv]=/usr/sbin/atd -l 0.8 -b 60 ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
RemainAfterExit=no
bor@opensuse:~> sudo systemctl start atd.service
bor@opensuse:~> sudo systemctl status atd.service
atd.service - Execution Queue Daemon
Loaded: loaded (/etc/systemd/system/atd.service; disabled)
Active: active (running) since Sun, 25 Nov 2012 10:38:06 +0400; 2s ago
Process: 7988 ExecStart=/usr/sbin/atd -l 0.8 -b 60 (code=exited, status=0/SUCCESS)
Main PID: 7989 (atd)
CGroup: name=systemd:/system/atd.service
└ 7989 /usr/sbin/atd -l 0.8 -b 60
Nov 25 10:38:06 opensuse.site atd[7989]: Removing stale lockfile for pid 7906
On 2012-11-25 07:46, arvidjaar wrote:
>
> malcolmlewis;2506321 Wrote:
>> Those are valid options to use without using the system config file.
>
> It does not really answer the question. Those are valid options but are
> optional.
Indeed.
-l Specifies a limiting load factor, over which batch
jobs should not be run, instead of the compile-time
choice of 0.8.
For an SMP system with n CPUs, you will probably want
to set this higher than n-1.
-b Specifiy the minimum interval in seconds between the
start of two batch jobs (60 default).
It does not explain why those options make the service work. In fact, I
do not see the relation at all.
> Adding them to atd.service ExecStart will should not fix atd
> start. What is required is either Type=forking or RemainAfterExit=true
> and that was missing in description. To illustrate:
Aha.
…
> Adding either Type=forking (which is the real and correct fix, because
> that is what atd does) will enable systemd to correct recognize that
> service is started and what is the main PID of service:
Interesting.
It makes a lot more sense, thanks.
–
Cheers / Saludos,
Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))