Re: [gentoo-user] looking for a couple of systemd units

2013-08-29 Thread Graham Murray
Stefan G. Weichinger li...@xunil.at writes:

 Just found this note from Pacho on planet.gentoo.org:

 http://my.opera.com/pacho/blog/2013/08/27/how-to-write-proper-systemd-unit-files

 I will have to review some of my files then ;-)

What I did not understand from reading that is why he (or gentoo policy)
does not like 'type=forking'. Reading the systemd man files, I thought
that type=forking would be the natural choice for most daemons.



Re: [gentoo-user] looking for a couple of systemd units

2013-08-29 Thread Canek Peláez Valdés
On Fri, Aug 30, 2013 at 12:24 AM, Graham Murray gra...@gmurray.org.uk wrote:
 Stefan G. Weichinger li...@xunil.at writes:

 Just found this note from Pacho on planet.gentoo.org:

 http://my.opera.com/pacho/blog/2013/08/27/how-to-write-proper-systemd-unit-files

 I will have to review some of my files then ;-)

 What I did not understand from reading that is why he (or gentoo policy)
 does not like 'type=forking'. Reading the systemd man files, I thought
 that type=forking would be the natural choice for most daemons.

On the contrary; with Type=simple systemd has better control on the
service, since systemd itself execv() the service binary, and it can
know precisely its PID and when it finishes. With Type=forking systemd
has to guess what the PID is, and therefore it nees more work to know
the status of the service. It does a pretty good job, but it's easier
with Type=simple.

Type=forking is there for old daemons that don't have a --foreground
or similar option.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-28 Thread Stefan G. Weichinger

Had problems configuring the static network inside a gentoo VM.

The network never came up but when I logged in and started the
network.service manually it worked. Strange.

The mentioned service-file was the one here (my posting with /bin/ip):

http://gentoo.2317880.n4.nabble.com/Systemd-and-static-network-td265801.html

So I googled some more and used the more complex file from arch:

https://wiki.archlinux.org/index.php/Network_Configuration#Manual_connection_at_boot_using_systemd

With this the VM gets connected fine now.

It's even more flexible as it allows to set up multiple NICs by simply
creating the corresponding config-file in /etc/conf.d



Re: [gentoo-user] looking for a couple of systemd units

2013-08-28 Thread Stefan G. Weichinger
Am 28.08.2013 08:03, schrieb Stefan G. Weichinger:
 
 Had problems configuring the static network inside a gentoo VM.
 
 The network never came up but when I logged in and started the
 network.service manually it worked. Strange.

before you ask: yes, the service was enabled correctly (double-checked,
redone ...)




Re: [gentoo-user] looking for a couple of systemd units

2013-08-28 Thread Stefan G. Weichinger
Am 27.08.2013 18:57, schrieb Canek Peláez Valdés:

 Canek, how to best tell the gentoo-devs about all these files?
 Filing bugs for every single file?
 
 Yeah, to the package in question. Probably with a CC to the systemd
 team, so they add the unit file if the maintainer takes too much to
 acknowledge the bug.
 
 I haven't done it myself with all the units I already have, I haven't
 gotten the time.

Just found this note from Pacho on planet.gentoo.org:

http://my.opera.com/pacho/blog/2013/08/27/how-to-write-proper-systemd-unit-files

I will have to review some of my files then ;-)

Stefan



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread covici
Canek Peláez Valdés can...@gmail.com wrote:

 On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés can...@gmail.com 
 wrote:
  On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
  Hi.  I am looking for a couple of systemd units which I have not been
  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=Mailman mailing list service
  After=network.target
 
  [Service]
  Type=forking
  ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
  ExecStop=/usr/lib/mailman/bin/mailmanctl stop
  User=mailman
  Group=mailman
 
  [Install]
  WantedBy=multi-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=The Internet News daemon
 Documentation=man:innd(8)
 ConditionPathExists=/var/run/news
 
 [Service]
 Type=simple
 ExecStart=/usr/lib/news/bin/rc.news
 ExecStop=/usr/lib/news/bin/rc.news stop
 User=news
 Group=news
 
 [Install]
 WantedBy=multi-user.target
 
 
 If the binary rc.news forks itself (and there is no option to force it
 to run in the foreground), use Type=forking. The former is preferred
 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 this
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?


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Canek Peláez Valdés
On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
 Canek Peláez Valdés can...@gmail.com wrote:

 On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés can...@gmail.com 
 wrote:
  On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
  Hi.  I am looking for a couple of systemd units which I have not been
  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=Mailman mailing list service
  After=network.target
 
  [Service]
  Type=forking
  ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
  ExecStop=/usr/lib/mailman/bin/mailmanctl stop
  User=mailman
  Group=mailman
 
  [Install]
  WantedBy=multi-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=The Internet News daemon
 Documentation=man:innd(8)
 ConditionPathExists=/var/run/news

 [Service]
 Type=simple
 ExecStart=/usr/lib/news/bin/rc.news
 ExecStop=/usr/lib/news/bin/rc.news stop
 User=news
 Group=news

 [Install]
 WantedBy=multi-user.target
 

 If the binary rc.news forks itself (and there is no option to force it
 to run in the foreground), use Type=forking. The former is preferred
 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 this
 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.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread covici
Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
  Canek Peláez Valdés can...@gmail.com wrote:
 
  On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés can...@gmail.com 
  wrote:
   On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
   Hi.  I am looking for a couple of systemd units which I have not been
   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=Mailman mailing list service
   After=network.target
  
   [Service]
   Type=forking
   ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
   ExecStop=/usr/lib/mailman/bin/mailmanctl stop
   User=mailman
   Group=mailman
  
   [Install]
   WantedBy=multi-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=The Internet News daemon
  Documentation=man:innd(8)
  ConditionPathExists=/var/run/news
 
  [Service]
  Type=simple
  ExecStart=/usr/lib/news/bin/rc.news
  ExecStop=/usr/lib/news/bin/rc.news stop
  User=news
  Group=news
 
  [Install]
  WantedBy=multi-user.target
  
 
  If the binary rc.news forks itself (and there is no option to force it
  to run in the foreground), use Type=forking. The former is preferred
  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 this
  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.

It looks like openrc is supporting some version of this, but not very
well documented at all except they refer you to some man page as of a
certain date.


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread covici
Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
  Canek Peláez Valdés can...@gmail.com wrote:
 
  On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés can...@gmail.com 
  wrote:
   On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
   Hi.  I am looking for a couple of systemd units which I have not been
   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=Mailman mailing list service
   After=network.target
  
   [Service]
   Type=forking
   ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
   ExecStop=/usr/lib/mailman/bin/mailmanctl stop
   User=mailman
   Group=mailman
  
   [Install]
   WantedBy=multi-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=The Internet News daemon
  Documentation=man:innd(8)
  ConditionPathExists=/var/run/news
 
  [Service]
  Type=simple
  ExecStart=/usr/lib/news/bin/rc.news
  ExecStop=/usr/lib/news/bin/rc.news stop
  User=news
  Group=news
 
  [Install]
  WantedBy=multi-user.target
  
 
  If the binary rc.news forks itself (and there is no option to force it
  to run in the foreground), use Type=forking. The former is preferred
  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 this
  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?


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Canek Peláez Valdés
On Tue, Aug 27, 2013 at 2:46 AM,  cov...@ccs.covici.com wrote:
 Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
  Canek Peláez Valdés can...@gmail.com wrote:
 
  On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés can...@gmail.com 
  wrote:
   On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
   Hi.  I am looking for a couple of systemd units which I have not been
   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=Mailman mailing list service
   After=network.target
  
   [Service]
   Type=forking
   ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
   ExecStop=/usr/lib/mailman/bin/mailmanctl stop
   User=mailman
   Group=mailman
  
   [Install]
   WantedBy=multi-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=The Internet News daemon
  Documentation=man:innd(8)
  ConditionPathExists=/var/run/news
 
  [Service]
  Type=simple
  ExecStart=/usr/lib/news/bin/rc.news
  ExecStop=/usr/lib/news/bin/rc.news stop
  User=news
  Group=news
 
  [Install]
  WantedBy=multi-user.target
  
 
  If the binary rc.news forks itself (and there is no option to force it
  to run in the foreground), use Type=forking. The former is preferred
  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 this
  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=755)

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.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Samuli Suominen

On 27/08/13 09:24, Canek Peláez Valdés wrote:

On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:

Canek Peláez Valdés can...@gmail.com wrote:


On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés can...@gmail.com wrote:

On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:

Hi.  I am looking for a couple of systemd units which I have not been
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=Mailman mailing list service
After=network.target

[Service]
Type=forking
ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
ExecStop=/usr/lib/mailman/bin/mailmanctl stop
User=mailman
Group=mailman

[Install]
WantedBy=multi-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=The Internet News daemon
Documentation=man:innd(8)
ConditionPathExists=/var/run/news

[Service]
Type=simple
ExecStart=/usr/lib/news/bin/rc.news
ExecStop=/usr/lib/news/bin/rc.news stop
User=news
Group=news

[Install]
WantedBy=multi-user.target


If the binary rc.news forks itself (and there is no option to force it
to run in the foreground), use Type=forking. The former is preferred
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 this
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.


openrc-0.11.8 already had initial tmpfiles support, but it's very buggy

however ~arch has now openrc-0.12, you could say, complete tmpfiles 
support and it's already being used at production level packages like 
sys-apps/kmod's kmod-static-nodes init script


so the same tmpfiles systemd uses, will work fine on openrc-0.12 too, 
long as tmpfiles.setup is in the boot runlevel...


- Samuli



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread covici
Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 2:46 AM,  cov...@ccs.covici.com wrote:
  Canek Peláez Valdés can...@gmail.com wrote:
 
  On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
   Canek Peláez Valdés can...@gmail.com wrote:
  
   On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés 
   can...@gmail.com wrote:
On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
Hi.  I am looking for a couple of systemd units which I have not been
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=Mailman mailing list service
After=network.target
   
[Service]
Type=forking
ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
ExecStop=/usr/lib/mailman/bin/mailmanctl stop
User=mailman
Group=mailman
   
[Install]
WantedBy=multi-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=The Internet News daemon
   Documentation=man:innd(8)
   ConditionPathExists=/var/run/news
  
   [Service]
   Type=simple
   ExecStart=/usr/lib/news/bin/rc.news
   ExecStop=/usr/lib/news/bin/rc.news stop
   User=news
   Group=news
  
   [Install]
   WantedBy=multi-user.target
   
  
   If the binary rc.news forks itself (and there is no option to force it
   to run in the foreground), use Type=forking. The former is preferred
   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 this
   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=755)
 
 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?


-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Canek Peláez Valdés
On Tue, Aug 27, 2013 at 9:41 AM,  cov...@ccs.covici.com wrote:
 Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 2:46 AM,  cov...@ccs.covici.com wrote:
  Canek Peláez Valdés can...@gmail.com wrote:
 
  On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
   Canek Peláez Valdés can...@gmail.com wrote:
  
   On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés 
   can...@gmail.com wrote:
On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
Hi.  I am looking for a couple of systemd units which I have not 
been
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=Mailman mailing list service
After=network.target
   
[Service]
Type=forking
ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
ExecStop=/usr/lib/mailman/bin/mailmanctl stop
User=mailman
Group=mailman
   
[Install]
WantedBy=multi-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=The Internet News daemon
   Documentation=man:innd(8)
   ConditionPathExists=/var/run/news
  
   [Service]
   Type=simple
   ExecStart=/usr/lib/news/bin/rc.news
   ExecStop=/usr/lib/news/bin/rc.news stop
   User=news
   Group=news
  
   [Install]
   WantedBy=multi-user.target
   
  
   If the binary rc.news forks itself (and there is no option to force it
   to run in the foreground), use Type=forking. The former is preferred
   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 this
   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=755)

 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.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread covici
Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 9:41 AM,  cov...@ccs.covici.com wrote:
  Canek Peláez Valdés can...@gmail.com wrote:
 
  On Tue, Aug 27, 2013 at 2:46 AM,  cov...@ccs.covici.com wrote:
   Canek Peláez Valdés can...@gmail.com wrote:
  
   On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
Canek Peláez Valdés can...@gmail.com wrote:
   
On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés 
can...@gmail.com wrote:
 On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
 Hi.  I am looking for a couple of systemd units which I have not 
 been
 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=Mailman mailing list service
 After=network.target

 [Service]
 Type=forking
 ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
 ExecStop=/usr/lib/mailman/bin/mailmanctl stop
 User=mailman
 Group=mailman

 [Install]
 WantedBy=multi-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=The Internet News daemon
Documentation=man:innd(8)
ConditionPathExists=/var/run/news
   
[Service]
Type=simple
ExecStart=/usr/lib/news/bin/rc.news
ExecStop=/usr/lib/news/bin/rc.news stop
User=news
Group=news
   
[Install]
WantedBy=multi-user.target

   
If the binary rc.news forks itself (and there is no option to force 
it
to run in the foreground), use Type=forking. The former is preferred
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 
this
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=755)
 
  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.
 

I need regular users to put files in /var/lock and it is annoying to
have to change the 

Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger

While we are at it ...

I am currently migrating one of my basement servers ... it boots and
runs with systemd already.

I am fiddling with service-files for:

mysql
mythbackend
tftp-hpa

(more to come)

working my way through ... making arch-linux-files fit etc.

If someone already has those for gentoo ... pls post and share!

Stefan



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Canek Peláez Valdés
On Tue, Aug 27, 2013 at 10:39 AM,  cov...@ccs.covici.com wrote:
 Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 9:41 AM,  cov...@ccs.covici.com wrote:
  Canek Peláez Valdés can...@gmail.com wrote:
 
  On Tue, Aug 27, 2013 at 2:46 AM,  cov...@ccs.covici.com wrote:
   Canek Peláez Valdés can...@gmail.com wrote:
  
   On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
Canek Peláez Valdés can...@gmail.com wrote:
   
On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés 
can...@gmail.com wrote:
 On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
 Hi.  I am looking for a couple of systemd units which I have not 
 been
 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=Mailman mailing list service
 After=network.target

 [Service]
 Type=forking
 ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
 ExecStop=/usr/lib/mailman/bin/mailmanctl stop
 User=mailman
 Group=mailman

 [Install]
 WantedBy=multi-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=The Internet News daemon
Documentation=man:innd(8)
ConditionPathExists=/var/run/news
   
[Service]
Type=simple
ExecStart=/usr/lib/news/bin/rc.news
ExecStop=/usr/lib/news/bin/rc.news stop
User=news
Group=news
   
[Install]
WantedBy=multi-user.target

   
If the binary rc.news forks itself (and there is no option to force 
it
to run in the foreground), use Type=forking. The former is preferred
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 
this
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=755)
 
  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.


 I need 

Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Canek Peláez Valdés
On Tue, Aug 27, 2013 at 10:55 AM, Stefan G. Weichinger li...@xunil.at wrote:

 While we are at it ...

 I am currently migrating one of my basement servers ... it boots and
 runs with systemd already.

 I am fiddling with service-files for:

 mysql
 mythbackend
 tftp-hpa

 (more to come)

 working my way through ... making arch-linux-files fit etc.

 If someone already has those for gentoo ... pls post and share!

This is my mysqld.service file used in production with Gentoo:


[Unit]
Description=mySQL Server
After=network.target
Documentation=man:mysqld(8)

[Service]
Type=simple
ExecStart=/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf
--basedir=/usr --datadir=/var/lib/mysql
--pid-file=/var/run/mysqld/mysqld.pid
--socket=/var/run/mysqld/mysqld.sock
ExecStop=/bin/kill -15 $MAINPID
PIDFile=/var/run/mysqld/mysql.pid
Restart=always
CPUSchedulingPolicy=idle
CPUSchedulingPriority=0

[Install]
WantedBy=multi-user.target


You can omit/ignore the CPScheduling* entries (it runs in a very old
machine, and I need mysql not to hog all the CPU).

Also, I use this in /etc/tmpfiles.d/mysqld.conf:


D /run/mysqld 0755 mysql mysql - -


I don't use mythbackend nor tftp-hpa, but if you have the init scripts
for them it should be easy to write the corresponding unit files.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 18:02, schrieb Canek Peláez Valdés:
 On Tue, Aug 27, 2013 at 10:55 AM, Stefan G. Weichinger li...@xunil.at wrote:

 While we are at it ...

 I am currently migrating one of my basement servers ... it boots and
 runs with systemd already.

 I am fiddling with service-files for:

 mysql
 mythbackend
 tftp-hpa

 (more to come)

 working my way through ... making arch-linux-files fit etc.

 If someone already has those for gentoo ... pls post and share!
 
 This is my mysqld.service file used in production with Gentoo:
 
 
 [Unit]
 Description=mySQL Server
 After=network.target
 Documentation=man:mysqld(8)
 
 [Service]
 Type=simple
 ExecStart=/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf
 --basedir=/usr --datadir=/var/lib/mysql
 --pid-file=/var/run/mysqld/mysqld.pid
 --socket=/var/run/mysqld/mysqld.sock
 ExecStop=/bin/kill -15 $MAINPID
 PIDFile=/var/run/mysqld/mysql.pid
 Restart=always
 CPUSchedulingPolicy=idle
 CPUSchedulingPriority=0
 
 [Install]
 WantedBy=multi-user.target
 
 
 You can omit/ignore the CPScheduling* entries (it runs in a very old
 machine, and I need mysql not to hog all the CPU).
 
 Also, I use this in /etc/tmpfiles.d/mysqld.conf:
 
 
 D /run/mysqld 0755 mysql mysql - -
 


Shouldn't it be /var/run/mysqld ... ?

I had a similar service-file   still fiddling to make it work,
nearly there. Thanks!


 I don't use mythbackend nor tftp-hpa, but if you have the init scripts
 for them it should be easy to write the corresponding unit files.

mythtv-Wiki provided a service file ... I will check after mysqld ...

Stefan



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Canek Peláez Valdés
On Tue, Aug 27, 2013 at 11:16 AM, Stefan G. Weichinger li...@xunil.at wrote:
 Am 27.08.2013 18:02, schrieb Canek Peláez Valdés:
 On Tue, Aug 27, 2013 at 10:55 AM, Stefan G. Weichinger li...@xunil.at 
 wrote:

 While we are at it ...

 I am currently migrating one of my basement servers ... it boots and
 runs with systemd already.

 I am fiddling with service-files for:

 mysql
 mythbackend
 tftp-hpa

 (more to come)

 working my way through ... making arch-linux-files fit etc.

 If someone already has those for gentoo ... pls post and share!

 This is my mysqld.service file used in production with Gentoo:

 
 [Unit]
 Description=mySQL Server
 After=network.target
 Documentation=man:mysqld(8)

 [Service]
 Type=simple
 ExecStart=/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf
 --basedir=/usr --datadir=/var/lib/mysql
 --pid-file=/var/run/mysqld/mysqld.pid
 --socket=/var/run/mysqld/mysqld.sock
 ExecStop=/bin/kill -15 $MAINPID
 PIDFile=/var/run/mysqld/mysql.pid
 Restart=always
 CPUSchedulingPolicy=idle
 CPUSchedulingPriority=0

 [Install]
 WantedBy=multi-user.target
 

 You can omit/ignore the CPScheduling* entries (it runs in a very old
 machine, and I need mysql not to hog all the CPU).

 Also, I use this in /etc/tmpfiles.d/mysqld.conf:

 
 D /run/mysqld 0755 mysql mysql - -
 


 Shouldn't it be /var/run/mysqld ... ?

It doesn't matter; as per the discussion above, /var/run should be a
bind mount of /run (the default in Gentoo), or a symbolic link to
/run. In either case, /var/run/mysqld *is* /run/mysqld.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 18:16, schrieb Stefan G. Weichinger:

 I don't use mythbackend nor tftp-hpa, but if you have the init scripts
 for them it should be easy to write the corresponding unit files.
 
 mythtv-Wiki provided a service file ... I will check after mysqld ...

up and running after a reboot, both mysqld and mythbackend (recording
already)!

-

Now for in.tftpd (needed for PXE-booting my mythtv-frontend).

https://wiki.archlinux.org/index.php/Tftpd_server

shows something, no success so far ...

But libvirt and my qemu-kvm-guests already work as well, fine!

Stefan



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 18:35, schrieb Stefan G. Weichinger:
 Am 27.08.2013 18:16, schrieb Stefan G. Weichinger:
 
 I don't use mythbackend nor tftp-hpa, but if you have the init scripts
 for them it should be easy to write the corresponding unit files.

 mythtv-Wiki provided a service file ... I will check after mysqld ...
 
 up and running after a reboot, both mysqld and mythbackend (recording
 already)!
 
 -
 
 Now for in.tftpd (needed for PXE-booting my mythtv-frontend).
 
 https://wiki.archlinux.org/index.php/Tftpd_server
 
 shows something, no success so far ...

Nearly there ... it also needs a socket ...




Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 18:40, schrieb Stefan G. Weichinger:

 Nearly there ... it also needs a socket ...

For the records:

# tftpd.service

[Unit]
Description=hpa's original TFTP daemon

[Service]
EnvironmentFile=/etc/conf.d/in.tftpd
ExecStart=/usr/sbin/in.tftpd ${INTFTPD_OPTS}
StandardInput=socket
StandardOutput=inherit
StandardError=journal

# tftpd.socket

[Socket]
ListenDatagram=69

[Install]
WantedBy=sockets.target

---

Next: NFS-server ;-)  (for exporting stuff to the mythfrontend)

... googling again ...

Canek, how to best tell the gentoo-devs about all these files?
Filing bugs for every single file?

Stefan




Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Canek Peláez Valdés
On Tue, Aug 27, 2013 at 11:46 AM, Stefan G. Weichinger li...@xunil.at wrote:
 Am 27.08.2013 18:40, schrieb Stefan G. Weichinger:

 Nearly there ... it also needs a socket ...

 For the records:

 # tftpd.service

 [Unit]
 Description=hpa's original TFTP daemon

 [Service]
 EnvironmentFile=/etc/conf.d/in.tftpd
 ExecStart=/usr/sbin/in.tftpd ${INTFTPD_OPTS}
 StandardInput=socket
 StandardOutput=inherit
 StandardError=journal

 # tftpd.socket

 [Socket]
 ListenDatagram=69

 [Install]
 WantedBy=sockets.target

 ---

 Next: NFS-server ;-)  (for exporting stuff to the mythfrontend)

 ... googling again ...

 Canek, how to best tell the gentoo-devs about all these files?
 Filing bugs for every single file?

Yeah, to the package in question. Probably with a CC to the systemd
team, so they add the unit file if the maintainer takes too much to
acknowledge the bug.

I haven't done it myself with all the units I already have, I haven't
gotten the time.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 18:46, schrieb Stefan G. Weichinger:
 Am 27.08.2013 18:40, schrieb Stefan G. Weichinger:
 
 Nearly there ... it also needs a socket ...
 
 For the records:
 
 # tftpd.service
 
 [Unit]
 Description=hpa's original TFTP daemon
 
 [Service]
 EnvironmentFile=/etc/conf.d/in.tftpd
 ExecStart=/usr/sbin/in.tftpd ${INTFTPD_OPTS}

sorry, this is not working as intended.

The syntax does not match (I thought I could read the default config-file).

For now:

ExecStart=/usr/sbin/in.tftpd /mnt/mypxe

S




Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 19:27, schrieb Stefan G. Weichinger:

 For now:
 
 ExecStart=/usr/sbin/in.tftpd /mnt/mypxe

And wrong again, it needs -s as well. Sorry for the noise!

ExecStart=/usr/sbin/in.tftpd -s /mnt/mypxe

-

For NFS I copied most out of this Wiki:

http://gentoo-en.vfose.ru/wiki/Systemd#NFS

for now I only use the parts for NFSv3 server ... mythfrontend starts up
right now!

slowly getting there ...



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 18:57, schrieb Canek Peláez Valdés:

 Canek, how to best tell the gentoo-devs about all these files?
 Filing bugs for every single file?
 
 Yeah, to the package in question. Probably with a CC to the systemd
 team, so they add the unit file if the maintainer takes too much to
 acknowledge the bug.
 
 I haven't done it myself with all the units I already have, I haven't
 gotten the time.

Yes, I understand.




Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 19:31, schrieb Stefan G. Weichinger:

 slowly getting there ...

Ok, I think I got that done.

Compared my /etc/runlevels/default and checked if I have all relevant
services up and running. Looks good!

What was/is missing (on my specific server) ?

services and sockets for:

in.tftpd
libvirtd
mythbackend
mysqld
nfs server
vixie-cron

While mythtv isn't really mainstream there are other daemons in this
list that really *should* be supported with USE=systemd, I assume
(sure, mythtv should get its file as well ...).

For sure this migration wasn't really *necessary* for me but kind of an
exercise and if I find the time and motivation to file all the bugs
other gentoo-users might benefit in the future.

I am gonna test-drive this setup now by watching TV on my PXE-booted
mythfrontend ;-)

Greets, Stefan




Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Canek Peláez Valdés
On Tue, Aug 27, 2013 at 1:12 PM, Stefan G. Weichinger li...@xunil.at wrote:
 Am 27.08.2013 19:31, schrieb Stefan G. Weichinger:

 slowly getting there ...

 Ok, I think I got that done.

 Compared my /etc/runlevels/default and checked if I have all relevant
 services up and running. Looks good!

 What was/is missing (on my specific server) ?

 services and sockets for:

 in.tftpd
 libvirtd
 mythbackend
 mysqld
 nfs server
 vixie-cron

 While mythtv isn't really mainstream there are other daemons in this
 list that really *should* be supported with USE=systemd, I assume
 (sure, mythtv should get its file as well ...).

No; the unit files should be installed by default by their respective
packages. No systemd USE flag, the same way there is no need for an
openrc USE flag to install init scripts in /etc/init.d

 For sure this migration wasn't really *necessary* for me but kind of an
 exercise and if I find the time and motivation to file all the bugs
 other gentoo-users might benefit in the future.

Thanks for doing that.

 I am gonna test-drive this setup now by watching TV on my PXE-booted
 mythfrontend ;-)

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 20:12, schrieb Stefan G. Weichinger:
 Am 27.08.2013 19:31, schrieb Stefan G. Weichinger:
 
 slowly getting there ...
 
 Ok, I think I got that done.
 
 Compared my /etc/runlevels/default and checked if I have all relevant
 services up and running. Looks good!
 
 What was/is missing (on my specific server) ?

And rsyncd:

https://github.com/vonSchlotzkow/systemd-gentoo-units/blob/master/sys-apps/systemd-units/files/services-server/rsyncd.service

S



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 20:15, schrieb Canek Peláez Valdés:

 While mythtv isn't really mainstream there are other daemons in this
 list that really *should* be supported with USE=systemd, I assume
 (sure, mythtv should get its file as well ...).
 
 No; the unit files should be installed by default by their respective
 packages. No systemd USE flag, the same way there is no need for an
 openrc USE flag to install init scripts in /etc/init.d

Yes, ok ... I will leave that to the devs then :-)

 For sure this migration wasn't really *necessary* for me but kind of an
 exercise and if I find the time and motivation to file all the bugs
 other gentoo-users might benefit in the future.
 
 Thanks for doing that.

It was a pleasure so far ;-)
Stefan




Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 20:12, schrieb Stefan G. Weichinger:

 What was/is missing (on my specific server) ?

I quickly browsed bugs.gentoo.org ...

libvirtd: I was wrong! The ebuild brings service-files.

No bugs filed yet for these:

in.tftpd mythbackend nfs server vixie-cron rsync

mysqld has a related bug already:

https://bugs.gentoo.org/show_bug.cgi?id=466084





Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread covici
Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 10:39 AM,  cov...@ccs.covici.com wrote:
  Canek Peláez Valdés can...@gmail.com wrote:
 
  On Tue, Aug 27, 2013 at 9:41 AM,  cov...@ccs.covici.com wrote:
   Canek Peláez Valdés can...@gmail.com wrote:
  
   On Tue, Aug 27, 2013 at 2:46 AM,  cov...@ccs.covici.com wrote:
Canek Peláez Valdés can...@gmail.com wrote:
   
On Tue, Aug 27, 2013 at 1:10 AM,  cov...@ccs.covici.com wrote:
 Canek Peláez Valdés can...@gmail.com wrote:

 On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés 
 can...@gmail.com wrote:
  On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com 
  wrote:
  Hi.  I am looking for a couple of systemd units which I have 
  not been
  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=Mailman mailing list service
  After=network.target
 
  [Service]
  Type=forking
  ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
  ExecStop=/usr/lib/mailman/bin/mailmanctl stop
  User=mailman
  Group=mailman
 
  [Install]
  WantedBy=multi-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=The Internet News daemon
 Documentation=man:innd(8)
 ConditionPathExists=/var/run/news

 [Service]
 Type=simple
 ExecStart=/usr/lib/news/bin/rc.news
 ExecStop=/usr/lib/news/bin/rc.news stop
 User=news
 Group=news

 [Install]
 WantedBy=multi-user.target
 

 If the binary rc.news forks itself (and there is no option to 
 force it
 to run in the foreground), use Type=forking. The former is 
 preferred
 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 
 this
 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=755)
  
   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 

Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread covici
Canek Peláez Valdés can...@gmail.com wrote:

 On Tue, Aug 27, 2013 at 10:55 AM, Stefan G. Weichinger li...@xunil.at wrote:
 
  While we are at it ...
 
  I am currently migrating one of my basement servers ... it boots and
  runs with systemd already.
 
  I am fiddling with service-files for:
 
  mysql
  mythbackend
  tftp-hpa
 
  (more to come)
 
  working my way through ... making arch-linux-files fit etc.
 
  If someone already has those for gentoo ... pls post and share!
 
 This is my mysqld.service file used in production with Gentoo:
 
 
 [Unit]
 Description=mySQL Server
 After=network.target
 Documentation=man:mysqld(8)
 
 [Service]
 Type=simple
 ExecStart=/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf
 --basedir=/usr --datadir=/var/lib/mysql
 --pid-file=/var/run/mysqld/mysqld.pid
 --socket=/var/run/mysqld/mysqld.sock
 ExecStop=/bin/kill -15 $MAINPID
 PIDFile=/var/run/mysqld/mysql.pid
 Restart=always
 CPUSchedulingPolicy=idle
 CPUSchedulingPriority=0
 
 [Install]
 WantedBy=multi-user.target
 
 
 You can omit/ignore the CPScheduling* entries (it runs in a very old
 machine, and I need mysql not to hog all the CPU).
 
 Also, I use this in /etc/tmpfiles.d/mysqld.conf:
 
 
 D /run/mysqld 0755 mysql mysql - -
 
 
 I don't use mythbackend nor tftp-hpa, but if you have the init scripts
 for them it should be easy to write the corresponding unit files.

Thanks for that, I will need thatas well.

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread covici
Stefan G. Weichinger li...@xunil.at wrote:

 Am 27.08.2013 18:46, schrieb Stefan G. Weichinger:
  Am 27.08.2013 18:40, schrieb Stefan G. Weichinger:
  
  Nearly there ... it also needs a socket ...
  
  For the records:
  
  # tftpd.service
  
  [Unit]
  Description=hpa's original TFTP daemon
  
  [Service]
  EnvironmentFile=/etc/conf.d/in.tftpd
  ExecStart=/usr/sbin/in.tftpd ${INTFTPD_OPTS}
 
 sorry, this is not working as intended.
 
 The syntax does not match (I thought I could read the default config-file).
 
 For now:
 
 ExecStart=/usr/sbin/in.tftpd /mnt/mypxe

Omit the braces.
-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 20:38, schrieb Stefan G. Weichinger:

 No bugs filed yet for these:
 
 in.tftpd mythbackend nfs server vixie-cron rsync

Filed some related bugs now:

https://bugs.gentoo.org/show_bug.cgi?id=482712
https://bugs.gentoo.org/show_bug.cgi?id=482714
https://bugs.gentoo.org/show_bug.cgi?id=482716
https://bugs.gentoo.org/show_bug.cgi?id=482718
https://bugs.gentoo.org/show_bug.cgi?id=482720

We'll see ...

Greets, Stefan



Re: [gentoo-user] looking for a couple of systemd units

2013-08-27 Thread Stefan G. Weichinger
Am 27.08.2013 22:52, schrieb cov...@ccs.covici.com:

 Omit the braces.

thanks ... doesn't work here anyway ... because $INTFTPD_OPTS also
includes ${INTFTPD_PATH} from within /etc/conf.d/in.tftpd (which can't
be resolved this way).

What works:

EnvironmentFile=/etc/conf.d/in.tftpd
ExecStart=/usr/sbin/in.tftpd -R 4096:32767 -s $INTFTPD_PATH

but ... still not satisfying. I think there might be a separate
conf.d-file or something.

Stefan



Re: [gentoo-user] looking for a couple of systemd units

2013-08-26 Thread Canek Peláez Valdés
On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
 Hi.  I am looking for a couple of systemd units which I have not been
 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=Mailman mailing list service
After=network.target

[Service]
Type=forking
ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
ExecStop=/usr/lib/mailman/bin/mailmanctl stop
User=mailman
Group=mailman

[Install]
WantedBy=multi-user.target


I don't have any for innd.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-26 Thread Canek Peláez Valdés
On Mon, Aug 26, 2013 at 11:06 PM, Canek Peláez Valdés can...@gmail.com wrote:
 On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
 Hi.  I am looking for a couple of systemd units which I have not been
 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=Mailman mailing list service
 After=network.target

 [Service]
 Type=forking
 ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
 ExecStop=/usr/lib/mailman/bin/mailmanctl stop
 User=mailman
 Group=mailman

 [Install]
 WantedBy=multi-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=The Internet News daemon
Documentation=man:innd(8)
ConditionPathExists=/var/run/news

[Service]
Type=simple
ExecStart=/usr/lib/news/bin/rc.news
ExecStop=/usr/lib/news/bin/rc.news stop
User=news
Group=news

[Install]
WantedBy=multi-user.target


If the binary rc.news forks itself (and there is no option to force it
to run in the foreground), use Type=forking. The former is preferred
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.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] looking for a couple of systemd units

2013-08-26 Thread covici
Canek Peláez Valdés can...@gmail.com wrote:

 On Mon, Aug 26, 2013 at 10:52 PM,  cov...@ccs.covici.com wrote:
  Hi.  I am looking for a couple of systemd units which I have not been
  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=Mailman mailing list service
 After=network.target
 
 [Service]
 Type=forking
 ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
 ExecStop=/usr/lib/mailman/bin/mailmanctl stop
 User=mailman
 Group=mailman
 
 [Install]
 WantedBy=multi-user.target
 
 
 I don't have any for innd.

OK, thanks.  

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com