From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5CD261381F3 for ; Tue, 27 Aug 2013 13:58:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC40CE0EAA; Tue, 27 Aug 2013 13:58:20 +0000 (UTC) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A20D3E0D8E for ; Tue, 27 Aug 2013 13:58:19 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id v1so2589309lbd.17 for ; Tue, 27 Aug 2013 06:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=82AV3aN/EAJpp3QNgepqhRkou3nbBJrLUNq45qeP0CA=; b=M4sLaYDQWJhRZGI8yPcDAvRASn9UUaLaFDhbH2OnsS3m6rZ4S1R3tCA+PKJLhPj+MD FHwT7UmJ45ISY/XdexkhpVWmHX3Ydh3cjLMbsytTwmRVJBM8yDMGJ74jEYZPp9g72ieG sUjpLyHs6Zr5DQh1RrRBuf+ZyNgBoy8cz56+Ke9oSpiXy6vnDY8SNpWTwRDmOB+F0DK5 TJ84Ln365V3OwjCC1HY1LqizIZ5NMg8LFW59tSvqBYUse6HcjJjWKuvbtl6w9z4maIyW NNw0dPBNGsLkyuJc8IpW0fX+mr0o352UDpihsar7bBT3xYDRGvUzMGD3P7QbJyM2rifF vQsw== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.112.74.20 with SMTP id p20mr1678956lbv.36.1377611897863; Tue, 27 Aug 2013 06:58:17 -0700 (PDT) Received: by 10.114.96.2 with HTTP; Tue, 27 Aug 2013 06:58:17 -0700 (PDT) In-Reply-To: <22172.1377589617@ccs.covici.com> References: <22350.1377575576@ccs.covici.com> <8165.1377583831@ccs.covici.com> <22172.1377589617@ccs.covici.com> Date: Tue, 27 Aug 2013 08:58:17 -0500 Message-ID: Subject: Re: [gentoo-user] looking for a couple of systemd units From: =?UTF-8?B?Q2FuZWsgUGVsw6FleiBWYWxkw6lz?= To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 911ff150-a4a1-45c6-b787-44c63f74d8e5 X-Archives-Hash: 5c0d7c95b0d716815d612498054659eb On Tue, Aug 27, 2013 at 2:46 AM, wrote: > Canek Pel=C3=A1ez Vald=C3=A9s wrote: > >> On Tue, Aug 27, 2013 at 1:10 AM, wrote: >> > Canek Pel=C3=A1ez Vald=C3=A9s wrote: >> > >> >> On Mon, Aug 26, 2013 at 11:06 PM, Canek Pel=C3=A1ez Vald=C3=A9s wrote: >> >> > On Mon, Aug 26, 2013 at 10:52 PM, wrote: >> >> >> Hi. I am looking for a couple of systemd units which I have not b= een >> >> >> able to find -- one for mailman and one for innd which is a shell = script >> >> >> by itself. >> >> >> >> >> >> Thanks in advance for any suggestions. >> >> > >> >> > I use this one in production for mailman with Gentoo: >> >> > >> >> > ---------------------------------------------------------------- >> >> > [Unit] >> >> > Description=3DMailman mailing list service >> >> > After=3Dnetwork.target >> >> > >> >> > [Service] >> >> > Type=3Dforking >> >> > ExecStart=3D/usr/lib/mailman/bin/mailmanctl -s start >> >> > ExecStop=3D/usr/lib/mailman/bin/mailmanctl stop >> >> > User=3Dmailman >> >> > Group=3Dmailman >> >> > >> >> > [Install] >> >> > WantedBy=3Dmulti-user.target >> >> > ---------------------------------------------------------------- >> >> > >> >> > I don't have any for innd. >> >> >> >> If innd is the one from net-nntp/inn, then the following should work: >> >> >> >> ---------------------------------------------------------------- >> >> [Unit] >> >> Description=3DThe Internet News daemon >> >> Documentation=3Dman:innd(8) >> >> ConditionPathExists=3D/var/run/news >> >> >> >> [Service] >> >> Type=3Dsimple >> >> ExecStart=3D/usr/lib/news/bin/rc.news >> >> ExecStop=3D/usr/lib/news/bin/rc.news stop >> >> User=3Dnews >> >> Group=3Dnews >> >> >> >> [Install] >> >> WantedBy=3Dmulti-user.target >> >> ---------------------------------------------------------------- >> >> >> >> If the binary rc.news forks itself (and there is no option to force i= t >> >> to run in the foreground), use Type=3Dforking. The former is preferre= d >> >> over the latter. Also, to guarantee that the directory /var/run/news >> >> always is present, add the following to a new file >> >> /etc/tmpfiles.d/innd.conf: >> >> >> >> ---------------------------------------------------------------- >> >> d /var/run/news 0755 news news 10d - >> >> ---------------------------------------------------------------- >> >> >> >> You can replace 10d with - (hypen), so the directory is never cleaned >> >> automatically. If you try this unit and it works as expected, please >> >> let us know. >> >> >> > >> > OK, thanks again. I have one question which this brings up -- and thi= s >> > applies to openrc as well -- I never have let it migrate /var/run to >> > /run and /var/lock likewise because I have directories in those which >> > are owned by various users, etc. and the packages themselves almost >> > never create such -- is putting things in /etc/tmpfiles.d the correct >> > way to fix this? >> >> tmpfiles.d is from systemd: >> >> http://www.freedesktop.org/software/systemd/man/tmpfiles.d.html >> >> However, I think OpenRC developers were thinking about supporting it. >> I don't know if that actually happened. >> >> With systemd in Gentoo, /var/run is bind mounted from /run, and it's a >> tmpfs dir, so everything there goes away after a reboot. The config >> files in tmpfiles.d allows the creation (and automatic removal) of >> directories and files there. >> >> I don't know if it's the "correct" way to fix anything; but it works. >> > Can I use the d action to change the permissions of an existing > directory and if not, how can I do this? I don't think so. The contents of /run (and /var/run before it) are, by definition, used only at run time. They are not intended to be preserved, and they actually should be cleaned from time to time (hence the age field in tmpfiles.d). Therefore tmpfiles.d only deals with creation (and cleaning up) of files/directories, not "updating" them, since they should not be even present when the system boots up. The files in /etc/tmpfiles.d are used by the systemd-tmpfiles-* units, and (AFAIU) they only create files/directories at boot time, and then only clean afterwards. My /run directory is really empty. When my systems boot up, systemd mounts a tmpfs on it: # mount | grep "on /run" tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=3D755) Then the var-run.mount unit binds mount /run into /var/run. So no file/directory there is actually written into any physical disk ever. Regards. --=20 Canek Pel=C3=A1ez Vald=C3=A9s Posgrado en Ciencia e Ingenier=C3=ADa de la Computaci=C3=B3n Universidad Nacional Aut=C3=B3noma de M=C3=A9xico