opensuse 12.2 fresh install atd daemon broken

On Sun 25 Nov 2012 01:18:11 AM CST, Carlos E. R. wrote:

On 2012-11-24 23:26, guszamso wrote:

> I modified my atd.service file normaly under /lib/systemd/system to
> read:
>
> ExecStart=/usr/sbin/atd -l 10 -b 60

Why? What was the reasoning you had to do that, please?

Hi
Because it’s an open bug with the at systemd service…
https://bugzilla.novell.com/show_bug.cgi?id=780259

Those are valid options to use without using the system config file.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.11-2.16-desktop
up 1 day 1:46, 5 users, load average: 3.53, 2.50, 1.60
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

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:


bor@opensuse:~> systemctl --no-pager show atd.service -p ExecStart -p RemainAfterExit -p Type
Type=simple
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: deactivating (stop-sigterm) since Sun, 25 Nov 2012 10:33:44 +0400; 22s ago
     Process: 7905 ExecStart=/usr/sbin/atd -l 0.8 -b 60 (code=exited, status=0/SUCCESS)
      CGroup: name=systemd:/system/atd.service
          └ 7906 /usr/sbin/atd -l 0.8 -b 60

and looking at debug output

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))

On 2012-10-31 01:56, Wikinaut wrote:
> Please supply a fix soon.

Don’t tell us, tell “them”.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

I think this issue is now fixed with the latest patch to apd .