Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] looking for a couple of systemd units
Date: Tue, 27 Aug 2013 06:24:38
Message-Id: CADPrc81E8k7_VABogYHZPdr8AXxCdm+deOBmRx+=Vwg6ykgzdw@mail.gmail.com
In Reply to: Re: [gentoo-user] looking for a couple of systemd units by covici@ccs.covici.com
1 On Tue, Aug 27, 2013 at 1:10 AM, <covici@××××××××××.com> wrote:
2 > Canek Peláez Valdés <caneko@×××××.com> wrote:
3 >
4 >> On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés <caneko@×××××.com> wrote:
5 >> > On Mon, Aug 26, 2013 at 10:52 PM, <covici@××××××××××.com> wrote:
6 >> >> Hi. I am looking for a couple of systemd units which I have not been
7 >> >> able to find -- one for mailman and one for innd which is a shell script
8 >> >> by itself.
9 >> >>
10 >> >> Thanks in advance for any suggestions.
11 >> >
12 >> > I use this one in production for mailman with Gentoo:
13 >> >
14 >> > ----------------------------------------------------------------
15 >> > [Unit]
16 >> > Description=Mailman mailing list service
17 >> > After=network.target
18 >> >
19 >> > [Service]
20 >> > Type=forking
21 >> > ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
22 >> > ExecStop=/usr/lib/mailman/bin/mailmanctl stop
23 >> > User=mailman
24 >> > Group=mailman
25 >> >
26 >> > [Install]
27 >> > WantedBy=multi-user.target
28 >> > ----------------------------------------------------------------
29 >> >
30 >> > I don't have any for innd.
31 >>
32 >> If innd is the one from net-nntp/inn, then the following should work:
33 >>
34 >> ----------------------------------------------------------------
35 >> [Unit]
36 >> Description=The Internet News daemon
37 >> Documentation=man:innd(8)
38 >> ConditionPathExists=/var/run/news
39 >>
40 >> [Service]
41 >> Type=simple
42 >> ExecStart=/usr/lib/news/bin/rc.news
43 >> ExecStop=/usr/lib/news/bin/rc.news stop
44 >> User=news
45 >> Group=news
46 >>
47 >> [Install]
48 >> WantedBy=multi-user.target
49 >> ----------------------------------------------------------------
50 >>
51 >> If the binary rc.news forks itself (and there is no option to force it
52 >> to run in the foreground), use Type=forking. The former is preferred
53 >> over the latter. Also, to guarantee that the directory /var/run/news
54 >> always is present, add the following to a new file
55 >> /etc/tmpfiles.d/innd.conf:
56 >>
57 >> ----------------------------------------------------------------
58 >> d /var/run/news 0755 news news 10d -
59 >> ----------------------------------------------------------------
60 >>
61 >> You can replace 10d with - (hypen), so the directory is never cleaned
62 >> automatically. If you try this unit and it works as expected, please
63 >> let us know.
64 >>
65 >
66 > OK, thanks again. I have one question which this brings up -- and this
67 > applies to openrc as well -- I never have let it migrate /var/run to
68 > /run and /var/lock likewise because I have directories in those which
69 > are owned by various users, etc. and the packages themselves almost
70 > never create such -- is putting things in /etc/tmpfiles.d the correct
71 > way to fix this?
72
73 tmpfiles.d is from systemd:
74
75 http://www.freedesktop.org/software/systemd/man/tmpfiles.d.html
76
77 However, I think OpenRC developers were thinking about supporting it.
78 I don't know if that actually happened.
79
80 With systemd in Gentoo, /var/run is bind mounted from /run, and it's a
81 tmpfs dir, so everything there goes away after a reboot. The config
82 files in tmpfiles.d allows the creation (and automatic removal) of
83 directories and files there.
84
85 I don't know if it's the "correct" way to fix anything; but it works.
86
87 Regards.
88 --
89 Canek Peláez Valdés
90 Posgrado en Ciencia e Ingeniería de la Computación
91 Universidad Nacional Autónoma de México

Replies

Subject Author
Re: [gentoo-user] looking for a couple of systemd units covici@××××××××××.com
Re: [gentoo-user] looking for a couple of systemd units covici@××××××××××.com
Re: [gentoo-user] looking for a couple of systemd units Samuli Suominen <ssuominen@g.o>