Gentoo Archives: gentoo-user

From: Samuli Suominen <ssuominen@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] looking for a couple of systemd units
Date: Tue, 27 Aug 2013 14:17:09
Message-Id: 521CB4C0.3080707@gentoo.org
In Reply to: Re: [gentoo-user] looking for a couple of systemd units by "Canek Peláez Valdés"
1 On 27/08/13 09:24, Canek Peláez Valdés wrote:
2 > On Tue, Aug 27, 2013 at 1:10 AM, <covici@××××××××××.com> wrote:
3 >> Canek Peláez Valdés <caneko@×××××.com> wrote:
4 >>
5 >>> On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés <caneko@×××××.com> wrote:
6 >>>> On Mon, Aug 26, 2013 at 10:52 PM, <covici@××××××××××.com> wrote:
7 >>>>> Hi. I am looking for a couple of systemd units which I have not been
8 >>>>> able to find -- one for mailman and one for innd which is a shell script
9 >>>>> by itself.
10 >>>>>
11 >>>>> Thanks in advance for any suggestions.
12 >>>>
13 >>>> I use this one in production for mailman with Gentoo:
14 >>>>
15 >>>> ----------------------------------------------------------------
16 >>>> [Unit]
17 >>>> Description=Mailman mailing list service
18 >>>> After=network.target
19 >>>>
20 >>>> [Service]
21 >>>> Type=forking
22 >>>> ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
23 >>>> ExecStop=/usr/lib/mailman/bin/mailmanctl stop
24 >>>> User=mailman
25 >>>> Group=mailman
26 >>>>
27 >>>> [Install]
28 >>>> WantedBy=multi-user.target
29 >>>> ----------------------------------------------------------------
30 >>>>
31 >>>> I don't have any for innd.
32 >>>
33 >>> If innd is the one from net-nntp/inn, then the following should work:
34 >>>
35 >>> ----------------------------------------------------------------
36 >>> [Unit]
37 >>> Description=The Internet News daemon
38 >>> Documentation=man:innd(8)
39 >>> ConditionPathExists=/var/run/news
40 >>>
41 >>> [Service]
42 >>> Type=simple
43 >>> ExecStart=/usr/lib/news/bin/rc.news
44 >>> ExecStop=/usr/lib/news/bin/rc.news stop
45 >>> User=news
46 >>> Group=news
47 >>>
48 >>> [Install]
49 >>> WantedBy=multi-user.target
50 >>> ----------------------------------------------------------------
51 >>>
52 >>> If the binary rc.news forks itself (and there is no option to force it
53 >>> to run in the foreground), use Type=forking. The former is preferred
54 >>> over the latter. Also, to guarantee that the directory /var/run/news
55 >>> always is present, add the following to a new file
56 >>> /etc/tmpfiles.d/innd.conf:
57 >>>
58 >>> ----------------------------------------------------------------
59 >>> d /var/run/news 0755 news news 10d -
60 >>> ----------------------------------------------------------------
61 >>>
62 >>> You can replace 10d with - (hypen), so the directory is never cleaned
63 >>> automatically. If you try this unit and it works as expected, please
64 >>> let us know.
65 >>>
66 >>
67 >> OK, thanks again. I have one question which this brings up -- and this
68 >> applies to openrc as well -- I never have let it migrate /var/run to
69 >> /run and /var/lock likewise because I have directories in those which
70 >> are owned by various users, etc. and the packages themselves almost
71 >> never create such -- is putting things in /etc/tmpfiles.d the correct
72 >> way to fix this?
73 >
74 > tmpfiles.d is from systemd:
75 >
76 > http://www.freedesktop.org/software/systemd/man/tmpfiles.d.html
77 >
78 > However, I think OpenRC developers were thinking about supporting it.
79 > I don't know if that actually happened.
80
81 openrc-0.11.8 already had initial tmpfiles support, but it's very buggy
82
83 however ~arch has now openrc-0.12, you could say, complete tmpfiles
84 support and it's already being used at production level packages like
85 sys-apps/kmod's kmod-static-nodes init script
86
87 so the same tmpfiles systemd uses, will work fine on openrc-0.12 too,
88 long as tmpfiles.setup is in the boot runlevel...
89
90 - Samuli