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 AB30D1381F3 for ; Tue, 27 Aug 2013 14:48:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 02ADBE0D63; Tue, 27 Aug 2013 14:48:03 +0000 (UTC) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A5BF6E0B32 for ; Tue, 27 Aug 2013 14:48:01 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id u14so2619724lbd.2 for ; Tue, 27 Aug 2013 07:48:00 -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=zVSOeTRHXLbr7mAs2zr88LpId0i4PrELAvsC9OiJLLY=; b=PJ6Yih8LUJ05XLWMapVwHk9tKYslsl8pUzqV5i5KXFruBnMQmcha6udKxWAG2vdOJf uIqRDHi0MC23ck9yToFi3xS8QyNevGUXSH9ggtr9JcG87IMIGHpjbzmlMFXJIujt2sSp Zhugu2QSSaixQQDwWzQzOoeqf2dVffhU1u1lmu6NbjH97SyUrjEuqEVP6M+K2/rkdR3K 0mTaP1+qVJeuhSSVZP393UbqZdnJQj4DwoIlVs0Z3o5NWGi0q2hCtkR0I/i4/ygi4/K6 xZari2+iOp805HkCzzFrNFeWHSb2Q7Vfk/uCdkSQBYWXvXX7BrofLERwRyGFWjuuJztf jFUA== 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.9.195 with SMTP id c3mr2277365lbb.33.1377614879927; Tue, 27 Aug 2013 07:47:59 -0700 (PDT) Received: by 10.114.96.2 with HTTP; Tue, 27 Aug 2013 07:47:59 -0700 (PDT) In-Reply-To: <15373.1377614478@ccs.covici.com> References: <22350.1377575576@ccs.covici.com> <8165.1377583831@ccs.covici.com> <22172.1377589617@ccs.covici.com> <15373.1377614478@ccs.covici.com> Date: Tue, 27 Aug 2013 09:47:59 -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: 1dc40640-6df6-40a4-b270-018dac825ed4 X-Archives-Hash: 340e8232c2991401cd3a2d58dd2acea1 On Tue, Aug 27, 2013 at 9:41 AM, wrote: > Canek Pel=C3=A1ez Vald=C3=A9s wrote: > >> 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 no= t been >> >> >> >> able to find -- one for mailman and one for innd which is a she= ll 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 wo= rk: >> >> >> >> >> >> ---------------------------------------------------------------- >> >> >> [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 forc= e it >> >> >> to run in the foreground), use Type=3Dforking. The former is prefe= rred >> >> >> over the latter. Also, to guarantee that the directory /var/run/ne= ws >> >> >> 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 clea= ned >> >> >> automatically. If you try this unit and it works as expected, plea= se >> >> >> let us know. >> >> >> >> >> > >> >> > OK, thanks again. I have one question which this brings up -- and = this >> >> > applies to openrc as well -- I never have let it migrate /var/run t= o >> >> > /run and /var/lock likewise because I have directories in those wh= ich >> >> > are owned by various users, etc. and the packages themselves almost >> >> > never create such -- is putting things in /etc/tmpfiles.d the corr= ect >> >> > 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. > > But I need to change the permissions of /var/lock to 777, if I can't use > tmpfiles.d how can I do this? chmod 777 /var/lock? I don't understand the question. What program do you need that requires universal writing access for /var/lock? In my systems, /var/lock is either bind mounted from /run/lock, or a soft link to /run/lock, and /run/lock is root:root and 755. 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