Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Lennart Poettering
On Fri, 23.01.15 12:27, Cristian Rodríguez (crrodrig...@opensuse.org) wrote:

 El 23/01/15 a las 10:31, Lennart Poettering escribió:
 
 The rc-local generator only exists to add compat support for those
 systems where it never was a sysvinit script anyway...
 
 
 They are not init scripts though. but plain shell scripts with no dependency
 information. they are installed in /etc/init.d, therefore we end with units
 generated by both the sysv-generator and the rc-local generator.

Hmm? Are you talking about Debian or Suse now? I kinda assumed that if
Debian places it in /etc/init.d, that it is a proper sysvinit script...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Lennart Poettering
On Fri, 23.01.15 15:57, Michael Biebl (mbi...@gmail.com) wrote:

 2015-01-23 14:32 GMT+01:00 Lennart Poettering lenn...@poettering.net:
  On Fri, 23.01.15 04:24, Michael Biebl (mbi...@gmail.com) wrote:
 
  If distros still ship such a rc.local sysv init script, shouldn't they
  rather symlink that to
  the native rc-local.service? Sounds like the better alternative to me.
  Or alternatively, mask that service.
 
  E.g in Debian we have /etc/init.d/rc.local and ship a
  /lib/systemd/system/rc.local.service - rc-local.service
  symlink in the systemd package.
 
  I'd recommend not shipping the rc-local generator at all in Debian
  then. It was simply compat for some crappy logic where Fedora was
  executing two special scripts, that were not sysv during bootup and
  shutdown.
 
 Hm, you're probably right.
 I guess we could just statically enable rc-local.service in
 multi-user.target.wants and drop rc-local-generator.

I'd even remove rc-local.service from Debian. If this is a normal
sysvinit script, treat it as such, and let sysv-generator do its deed
on it. 

Given that you don't have the shutdown counterpart like Fedora has you
are then completely safe, without any special magic that we needed for
Fedora...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Simon McVittie
On 23/01/15 17:52, Lennart Poettering wrote:
 On Fri, 23.01.15 12:27, Cristian Rodríguez (crrodrig...@opensuse.org) wrote:
 El 23/01/15 a las 10:31, Lennart Poettering escribió:
 The rc-local generator only exists to add compat support for those
 systems where it never was a sysvinit script anyway...

 They are not init scripts though. but plain shell scripts with no dependency
 information. they are installed in /etc/init.d, therefore we end with units
 generated by both the sysv-generator and the rc-local generator.
 
 Hmm? Are you talking about Debian or Suse now? I kinda assumed that if
 Debian places it in /etc/init.d, that it is a proper sysvinit script...

In Debian, /etc/init.d/rc.local is a sysvinit script with LSB init info.
It is a normal sysvinit script, except that it has Required-Start: $all
so that it will be sequenced after all other init scripts.

It runs /etc/rc.local, which is a simple shell script with no dependency
magic. If a sysadmin has not customized /etc/rc.local, it only contains
some comments and exit 0.

S

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Cristian Rodríguez

El 23/01/15 a las 14:52, Lennart Poettering escribió:

On Fri, 23.01.15 12:27, Cristian Rodríguez (crrodrig...@opensuse.org) wrote:


El 23/01/15 a las 10:31, Lennart Poettering escribió:


The rc-local generator only exists to add compat support for those
systems where it never was a sysvinit script anyway...



They are not init scripts though. but plain shell scripts with no dependency
information. they are installed in /etc/init.d, therefore we end with units
generated by both the sysv-generator and the rc-local generator.


Hmm? Are you talking about Debian or Suse now? I kinda assumed that if
Debian places it in /etc/init.d, that it is a proper sysvinit script...


SUSE has this scripts..

Extra start script: /etc/init.d/boot.local
Extra stop script:   /etc/init.d/halt.local

The are not init scripts, but legacy shell scripts that naive people 
insist on wanting to use.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Michael Biebl
2015-01-23 18:51 GMT+01:00 Lennart Poettering lenn...@poettering.net:
 I'd even remove rc-local.service from Debian. If this is a normal
 sysvinit script, treat it as such, and let sysv-generator do its deed
 on it.

The /etc/init.d/rc.local init script does nothing else then run
/etc/rc.local, in case this file is executable.

By using the native rc-local.service file, we avoid one bash invocation.
Not that big of a deal, but if we can avoid that, why not.


Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Lennart Poettering
On Fri, 23.01.15 18:44, Simon McVittie (simon.mcvit...@collabora.co.uk) wrote:

 On 23/01/15 17:52, Lennart Poettering wrote:
  On Fri, 23.01.15 12:27, Cristian Rodríguez (crrodrig...@opensuse.org) wrote:
  El 23/01/15 a las 10:31, Lennart Poettering escribió:
  The rc-local generator only exists to add compat support for those
  systems where it never was a sysvinit script anyway...
 
  They are not init scripts though. but plain shell scripts with no 
  dependency
  information. they are installed in /etc/init.d, therefore we end with units
  generated by both the sysv-generator and the rc-local generator.
  
  Hmm? Are you talking about Debian or Suse now? I kinda assumed that if
  Debian places it in /etc/init.d, that it is a proper sysvinit script...
 
 In Debian, /etc/init.d/rc.local is a sysvinit script with LSB init info.
 It is a normal sysvinit script, except that it has Required-Start: $all
 so that it will be sequenced after all other init scripts.
 
 It runs /etc/rc.local, which is a simple shell script with no dependency
 magic. If a sysadmin has not customized /etc/rc.local, it only contains
 some comments and exit 0.

I see. In this case I would remove all of systemd's special rc-local
magic from the package and just make use of the normal sysvinit
support for it.

We can even add a compile time option to systemd upstream that
disables this part without removing all of sysvinit support.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Lennart Poettering
On Fri, 23.01.15 15:51, Cristian Rodríguez (crrodrig...@opensuse.org) wrote:

 El 23/01/15 a las 14:52, Lennart Poettering escribió:
 On Fri, 23.01.15 12:27, Cristian Rodríguez (crrodrig...@opensuse.org) wrote:
 
 El 23/01/15 a las 10:31, Lennart Poettering escribió:
 
 The rc-local generator only exists to add compat support for those
 systems where it never was a sysvinit script anyway...
 
 
 They are not init scripts though. but plain shell scripts with no dependency
 information. they are installed in /etc/init.d, therefore we end with units
 generated by both the sysv-generator and the rc-local generator.
 
 Hmm? Are you talking about Debian or Suse now? I kinda assumed that if
 Debian places it in /etc/init.d, that it is a proper sysvinit script...
 
 SUSE has this scripts..
 
 Extra start script: /etc/init.d/boot.local
 Extra stop script:   /etc/init.d/halt.local
 
 The are not init scripts, but legacy shell scripts that naive people insist
 on wanting to use.

Hmm, and tools that enumerate sysv scripts will now find both the real
sysvinit scripts and this one that actually isn't and cannot make
sense of it? 

What does chkconfig boot.local on traditionally do on Suse then? 

This appears to be a really weird setup on suse...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Colin Guthrie
Michael Biebl wrote on 23/01/15 03:24:
 and ship a
 /lib/systemd/system/rc.local.service - rc-local.service
 symlink in the systemd package.

Hmm, doesn't that break the
/usr/lib/systemd/system-generators/systemd-rc-local-generator logic? Or
do you not ship that in Debian?

The whole point of this generator is to look for /etc/init.d/rc.local
and check that it's executable and then add it in with appropriate deps
so it runs at the correct time (i.e. quite late)

Maybe I'm missing something that the above trick would achieve?

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Lennart Poettering
On Thu, 22.01.15 23:52, Cristian Rodríguez (crrodrig...@opensuse.org) wrote:

 ---
  src/sysv-generator/sysv-generator.c | 8 
  1 file changed, 8 insertions(+)
 
 diff --git a/src/sysv-generator/sysv-generator.c 
 b/src/sysv-generator/sysv-generator.c
 index b8b77aa..d6e4dfa 100644
 --- a/src/sysv-generator/sysv-generator.c
 +++ b/src/sysv-generator/sysv-generator.c
 @@ -775,6 +775,14 @@ static int enumerate_sysv(LookupPaths lp, Hashmap 
 *all_services) {
  fpath = strjoin(*path, /, de-d_name, NULL);
  if (!fpath)
  return log_oom();
 +#ifdef RC_LOCAL_SCRIPT_PATH_START
 +if(streq(fpath, RC_LOCAL_SCRIPT_PATH_START))
 +continue;
 +#endif
 +#ifdef RC_LOCAL_SCRIPT_PATH_STOP
 +if(streq(fpath, RC_LOCAL_SCRIPT_PATH_STOP))
 +continue;
 +#endif

Hmm? If you distro ships the rc local stuff as normal sysv init
script, then use that it as such, and consider dropping the rc-local
generator entirely from your distro.

The rc-local generator only exists to add compat support for those
systems where it never was a sysvinit script anyway...

The whole idea of rc.local is pretty crazy anyway, we certainly
shouldn't add more code for this anymore...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Lennart Poettering
On Fri, 23.01.15 04:24, Michael Biebl (mbi...@gmail.com) wrote:

 2015-01-23 3:52 GMT+01:00 Cristian Rodríguez crrodrig...@opensuse.org:
  ---
   src/sysv-generator/sysv-generator.c | 8 
   1 file changed, 8 insertions(+)
 
  diff --git a/src/sysv-generator/sysv-generator.c 
  b/src/sysv-generator/sysv-generator.c
  index b8b77aa..d6e4dfa 100644
  --- a/src/sysv-generator/sysv-generator.c
  +++ b/src/sysv-generator/sysv-generator.c
  @@ -775,6 +775,14 @@ static int enumerate_sysv(LookupPaths lp, Hashmap 
  *all_services) {
   fpath = strjoin(*path, /, de-d_name, NULL);
   if (!fpath)
   return log_oom();
  +#ifdef RC_LOCAL_SCRIPT_PATH_START
  +if(streq(fpath, RC_LOCAL_SCRIPT_PATH_START))
  +continue;
  +#endif
 
 If distros still ship such a rc.local sysv init script, shouldn't they
 rather symlink that to
 the native rc-local.service? Sounds like the better alternative to me.
 Or alternatively, mask that service.
 
 E.g in Debian we have /etc/init.d/rc.local and ship a
 /lib/systemd/system/rc.local.service - rc-local.service
 symlink in the systemd package.
 
  +#ifdef RC_LOCAL_SCRIPT_PATH_STOP
  +if(streq(fpath, RC_LOCAL_SCRIPT_PATH_STOP))
  +continue;
  +#endif
 
 Same here. Besides, isn't that stop script supposed to be /sbin/halt.local?
 Debian doesn't have such a halt.local script, so I assume this is/was
 some Red Hat / SuSE specific extension?

I'd recommend not shipping the rc-local generator at all in Debian
then. It was simply compat for some crappy logic where Fedora was
executing two special scripts, that were not sysv during bootup and
shutdown.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Martin Pitt
Michael Biebl [2015-01-23 13:27 +0100]:
 - It avoids that a rc.local.service file is generated by the sysv-generator

Not with upstream systemd, the sysv generator doesn't check if there's
already a unit of that name (as it produces them in generator.late/).
The Debian package has a patch for this [1]; it might make sense to
upstream this as I think it's generally a good idea -- there's no need
to synthesize units which we are never going to call, it's just a
waste of resources.

Martin

[1] 
http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/tree/debian/patches/Do-not-generate-systemd-units-from-sysv-init-scripts.patch?h=experimental

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Cristian Rodríguez

El 23/01/15 a las 10:31, Lennart Poettering escribió:


The rc-local generator only exists to add compat support for those
systems where it never was a sysvinit script anyway...



They are not init scripts though. but plain shell scripts with no 
dependency information. they are installed in /etc/init.d, therefore we 
end with units generated by both the sysv-generator and the rc-local 
generator.


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Michael Biebl
2015-01-23 14:32 GMT+01:00 Lennart Poettering lenn...@poettering.net:
 On Fri, 23.01.15 04:24, Michael Biebl (mbi...@gmail.com) wrote:

 If distros still ship such a rc.local sysv init script, shouldn't they
 rather symlink that to
 the native rc-local.service? Sounds like the better alternative to me.
 Or alternatively, mask that service.

 E.g in Debian we have /etc/init.d/rc.local and ship a
 /lib/systemd/system/rc.local.service - rc-local.service
 symlink in the systemd package.

 I'd recommend not shipping the rc-local generator at all in Debian
 then. It was simply compat for some crappy logic where Fedora was
 executing two special scripts, that were not sysv during bootup and
 shutdown.

Hm, you're probably right.
I guess we could just statically enable rc-local.service in
multi-user.target.wants and drop rc-local-generator.

rc-local.service already has a
ConditionFileIsExecutable=/etc/rc.local, so it seems it would dtrt
already.

Martin, what do you think?

Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-23 Thread Michael Biebl
2015-01-23 10:17 GMT+01:00 Colin Guthrie gm...@colin.guthr.ie:
 Michael Biebl wrote on 23/01/15 03:24:
 and ship a
 /lib/systemd/system/rc.local.service - rc-local.service
 symlink in the systemd package.

 Hmm, doesn't that break the
 /usr/lib/systemd/system-generators/systemd-rc-local-generator logic? Or
 do you not ship that in Debian?

 The whole point of this generator is to look for /etc/init.d/rc.local
 and check that it's executable and then add it in with appropriate deps
 so it runs at the correct time (i.e. quite late)

 Maybe I'm missing something that the above trick would achieve?

This trick achieves two things:
- It avoids that a rc.local.service file is generated by the sysv-generator
- It avoids that the rc.local.service is started (as a LSB service),
since we want this to be done by the native service.

afaics, /lib/systemd/system/rc-local.service always exists, the
rc-local generator only does the symlink into the
multi-user.target.wants directory.

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] sysv-generator: Do not generate units for files handled by rc-local generator

2015-01-22 Thread Michael Biebl
2015-01-23 3:52 GMT+01:00 Cristian Rodríguez crrodrig...@opensuse.org:
 ---
  src/sysv-generator/sysv-generator.c | 8 
  1 file changed, 8 insertions(+)

 diff --git a/src/sysv-generator/sysv-generator.c 
 b/src/sysv-generator/sysv-generator.c
 index b8b77aa..d6e4dfa 100644
 --- a/src/sysv-generator/sysv-generator.c
 +++ b/src/sysv-generator/sysv-generator.c
 @@ -775,6 +775,14 @@ static int enumerate_sysv(LookupPaths lp, Hashmap 
 *all_services) {
  fpath = strjoin(*path, /, de-d_name, NULL);
  if (!fpath)
  return log_oom();
 +#ifdef RC_LOCAL_SCRIPT_PATH_START
 +if(streq(fpath, RC_LOCAL_SCRIPT_PATH_START))
 +continue;
 +#endif

If distros still ship such a rc.local sysv init script, shouldn't they
rather symlink that to
the native rc-local.service? Sounds like the better alternative to me.
Or alternatively, mask that service.

E.g in Debian we have /etc/init.d/rc.local and ship a
/lib/systemd/system/rc.local.service - rc-local.service
symlink in the systemd package.

 +#ifdef RC_LOCAL_SCRIPT_PATH_STOP
 +if(streq(fpath, RC_LOCAL_SCRIPT_PATH_STOP))
 +continue;
 +#endif

Same here. Besides, isn't that stop script supposed to be /sbin/halt.local?
Debian doesn't have such a halt.local script, so I assume this is/was
some Red Hat / SuSE specific extension?

Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel