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