Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development (http://www.linux-archive.org/fedora-development/)
-   -   why does my systemd-services not work? (http://www.linux-archive.org/fedora-development/540471-why-does-my-systemd-services-not-work.html)

Reindl Harald 06-16-2011 10:49 AM

why does my systemd-services not work?
 
independent of the use of Type=simple,fork or oneshot systemd
always kills my services, the process is fired up and "status"
says "deactivating (stop-sigterm)" reuslting in the process is
killed after a short time

if i start the "/usr/bin/mpd" manually as root it starts, drop
permissions (switch to user mpd) and runs in background forever

the same happens with everything i try to migrate from sysv
to systemd except two perl-services :-(

> [Unit]
> Description=The Music Player Daemon
> After=syslog.target
>
> [Service]
> Type=fork
> ExecStart=/usr/bin/mpd
>
> [Install]
> WantedBy=multi-user.target


[root@testserver:~]$ systemctl start mpd.service

[root@testserver:~]$ ps aux | grep mpd
root 4344 0.1 2.5 542804 29988 pts/1 Sl 12:32 0:01 kate systemd-services/mpd.service
mpd 4557 0.0 1.0 456484 12932 ? Ssl 12:47 0:00 /usr/bin/mpd
root 4562 0.0 0.0 110668 860 pts/1 S+ 12:47 0:00 grep --color mpd

[root@testserver:~]$ netstat -l | grep mpd
tcp 0 0 0.0.0.0:mshvlm 0.0.0.0:* LISTEN 4557/mpd

[root@testserver:~]$ systemctl status mpd.service
mpd.service - The Music Player Daemon
Loaded: loaded (/lib/systemd/system/mpd.service)
Active: deactivating (stop-sigterm) since Thu, 16 Jun 2011 12:47:13 +0200; 14s ago
Process: 4554 ExecStart=/usr/bin/mpd (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/mpd.service
└ 4557 /usr/bin/mpd


--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Michal Schmidt 06-16-2011 10:53 AM

why does my systemd-services not work?
 
On 06/16/2011 12:49 PM, Reindl Harald wrote:
>> [Service]
>> Type=fork

Type=
Configures the process start-up type for this service unit.
One of simple, forking, oneshot, dbus, notify.

Try "forking", not "fork"
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Reindl Harald 06-16-2011 11:07 AM

why does my systemd-services not work?
 
thank you! in this case it was really a typo
but "dbmail-imapd" is/was correct with "forking"

you can see the master-porcess and a child shortly in ps aux but
after a few seconds systemd changes to "deactivating (stop-sigterm)"
and is killing the processes

[root@testserver:/lib/systemd/system]$ systemctl --system daemon-reload
[root@testserver:/lib/systemd/system]$ systemctl start dbmail-imapd.service

[root@testserver:/lib/systemd/system]$ ps aux | grep dbmail | grep imap
root 4997 0.0 0.0 63436 732 ? S 13:04 0:00 /usr/sbin/dbmail-imapd
dbmail 4998 0.5 0.2 174172 3340 ? S 13:04 0:00 /usr/sbin/dbmail-imapd

[root@testserver:/lib/systemd/system]$ systemctl status dbmail-imapd.service
dbmail-imapd.service - DBMail IMAP Server
Loaded: loaded (/lib/systemd/system/dbmail-imapd.service)
Active: inactive (dead) since Thu, 16 Jun 2011 13:04:59 +0200; 3s ago
Process: 4995 ExecStart=/usr/sbin/dbmail-imapd (code=exited, status=0/SUCCESS)
Main PID: 4996 (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/dbmail-imapd.service
[root@testserver:/lib/systemd/system]$ systemctl start dbmail-imapd.service

[root@testserver:/lib/systemd/system]$ systemctl status dbmail-imapd.service
dbmail-imapd.service - DBMail IMAP Server
Loaded: loaded (/lib/systemd/system/dbmail-imapd.service)
Active: deactivating (stop-sigterm) since Thu, 16 Jun 2011 13:05:11 +0200; 1s ago
Process: 5013 ExecStart=/usr/sbin/dbmail-imapd (code=exited, status=0/SUCCESS)
Main PID: 5014 (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/dbmail-imapd.service
├ 5015 /usr/sbin/dbmail-imapd
├ 5016 /usr/sbin/dbmail-imapd
└ 5018 /usr/sbin/dbmail-imapd

[root@testserver:/lib/systemd/system]$ cat dbmail-imapd.service
[Unit]
Description=DBMail IMAP Server
After=syslog.target mysqld.service local-fs.target network.target

[Service]
Type=forking
PIDFile=/var/run/dbmail-imapd.pid
ExecStart=/usr/sbin/dbmail-imapd

[Install]
WantedBy=multi-user.target


Am 16.06.2011 12:53, schrieb Michal Schmidt:
> On 06/16/2011 12:49 PM, Reindl Harald wrote:
>>> [Service]
>>> Type=fork
>
> Type=
> Configures the process start-up type for this service unit.
> One of simple, forking, oneshot, dbus, notify.
>
> Try "forking", not "fork"

--

Mit besten Grüßen, Reindl Harald
the lounge interactive design GmbH
A-1060 Vienna, Hofmühlgasse 17
CTO / software-development / cms-solutions
p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40
icq: 154546673, http://www.thelounge.net/

http://www.thelounge.net/signature.asc.what.htm

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Michal Schmidt 06-16-2011 11:25 AM

why does my systemd-services not work?
 
On 06/16/2011 01:07 PM, Reindl Harald wrote:
> you can see the master-porcess and a child shortly in ps aux but
> after a few seconds systemd changes to "deactivating (stop-sigterm)"
> and is killing the processes
...

> [root@testserver:/lib/systemd/system]$ systemctl status dbmail-imapd.service
> dbmail-imapd.service - DBMail IMAP Server
> Loaded: loaded (/lib/systemd/system/dbmail-imapd.service)
> Active: deactivating (stop-sigterm) since Thu, 16 Jun 2011 13:05:11 +0200; 1s ago
> Process: 5013 ExecStart=/usr/sbin/dbmail-imapd (code=exited, status=0/SUCCESS)
> Main PID: 5014 (code=exited, status=0/SUCCESS)

When the main PID of the service exits, the default action is to kill
the whole cgroup.
The question is why did the main PID exit in the first place.

Michal
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Reindl Harald 06-16-2011 11:30 AM

why does my systemd-services not work?
 
Am 16.06.2011 13:25, schrieb Michal Schmidt:
> On 06/16/2011 01:07 PM, Reindl Harald wrote:
>> you can see the master-porcess and a child shortly in ps aux but
>> after a few seconds systemd changes to "deactivating (stop-sigterm)"
>> and is killing the processes
> ...
>
>> [root@testserver:/lib/systemd/system]$ systemctl status dbmail-imapd.service
>> dbmail-imapd.service - DBMail IMAP Server
>> Loaded: loaded (/lib/systemd/system/dbmail-imapd.service)
>> Active: deactivating (stop-sigterm) since Thu, 16 Jun 2011 13:05:11 +0200; 1s ago
>> Process: 5013 ExecStart=/usr/sbin/dbmail-imapd (code=exited, status=0/SUCCESS)
>> Main PID: 5014 (code=exited, status=0/SUCCESS)
>
> When the main PID of the service exits, the default action is to kill
> the whole cgroup.
> The question is why did the main PID exit in the first place.

i can not answer this question :-(

strange is that the service unchanged is running at the moment
i have seen it one time also on boot start sucessful
but since with old sysv the service never stopped to work i am unhappy

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


All times are GMT. The time now is 09:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.