Bug 1035062

Summary: Tumbleweed no longer executes scripts in /etc/init.d
Product: [openSUSE] openSUSE Tumbleweed Reporter: Forgotten User zyq2BBozey <forgotten_zyq2BBozey>
Component: BasesystemAssignee: Franck Bui <fbui>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: fbui, forgotten_zyq2BBozey, kyrimis, nico.kruber, patrick.schaaf, petr.m, thomas.blume
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User zyq2BBozey 2017-04-20 04:30:14 UTC
As per the tital the latest updates of TW no longer execute scripts in /etc/init.d. The following are 2 examples of the problem I have encounted.

1 - I have a cut down TW server running named and openvpn. Noticed since the second last update neither the openvpn and named scripts now execute on init and I have to manually run them.

2 -  To confirm point I also have a TW install on a laptop with KDE and virtual box no longer runs, complains of missing drivers. Upon investigating further vbox have 2 scripts in /etc/init.d that needs to execute on startup, manually running them fixes any issues with VirtualBox.

Please let me know if you need any further information, i could not find any meaningful message in dmesg or journalctl. 

Cheers and thanks

Jerome
Comment 1 Chenzi Cao 2017-04-21 09:00:59 UTC
Ruediger, would you please take a look at this issue? I'm not sure whether it is right to assign it to you, please feel free to reassign whenever necessary, thank you :)
Comment 2 Ruediger Oertel 2017-04-21 10:55:15 UTC
actually I just ran into the same issue breaking the OBS buildservice worker images. but the bug is for systemd I guess ...
Comment 3 Thomas Blume 2017-04-21 12:39:00 UTC
(In reply to Ruediger Oertel from comment #2)
> actually I just ran into the same issue breaking the OBS buildservice worker
> images. but the bug is for systemd I guess ...

systemd version 232 has a special generator (systemd-sysv-generator) that converst the init scripts to systemd service units.
They are located below: /run/systemd/generator.late/

Checked via installing named on tumbleweed VERSION="20170328" 
It seems to work correctly:

-->
# ll /run/systemd/generator.late/ | grep named
-rw-r--r-- 1 root root 558 21. Apr 14:09 named.service
--<

Can you see the named.service file?
If so, does it work if you run:

systemctl enable named.service

and reboot?
Comment 4 Forgotten User zyq2BBozey 2017-04-22 07:09:32 UTC
Hi, 

the named files are located in /run/systemd/generator.late dir, as follows:

drwxr-xr-x  2 root root 140 Apr 22 16:48 ./
drwxr-xr-x 18 root root 460 Apr 22 16:51 ../
-rw-r--r--  1 root root 338 Apr 22 16:48 after.local.service
-rw-r--r--  1 root root 335 Apr 22 16:48 halt.local.service
-rw-r--r--  1 root root 407 Apr 22 16:48 local.service
-rw-r--r--  1 root root 558 Apr 22 16:48 named.service
-rw-r--r--  1 root root 609 Apr 22 16:48 openvpn.service

systemctl enable named output is

named.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable named

Upon reboot named is not running, i have to issue command 'systemctl start named', and all is OK.

I created my own openvpn script in init.d using insserv, again this was working before update 20170414 i think.

Sorry if I am putting this in the wrong place, my first time using bugzilla.

Thanks 
Jerome
Comment 5 Thomas Blume 2017-04-24 10:03:23 UTC
(In reply to JJ JJ from comment #4)
> Upon reboot named is not running, i have to issue command 'systemctl start
> named', and all is OK.
> 
> I created my own openvpn script in init.d using insserv, again this was
> working before update 20170414 i think.

I could reproduce the issue now.
Investigation showed that the bug appeared due to the removal of the below symlink:

lrwxrwxrwx 1 root root 12 24. Apr 11:14 /etc/rc.d -> /etc/init.d/

This was due to the following change in the filesystem package:

* Mi Mär 29 2017 kukuk@suse.de
- Move /etc/init.d hiearchy to insserv-compat

We need to keep this symlink for backward compatibility.
Thorsten, can you please take over?
Comment 6 Thorsten Kukuk 2017-04-24 10:07:11 UTC
(In reply to Thomas Blume from comment #5)

> We need to keep this symlink for backward compatibility.
> Thorsten, can you please take over?

Backward compatibility for software, which was written after LSB introduced the the LSB SysV init script standard???

Sorry, please fix systemd that it works on LSB SysV init systems and not only on RHEL.
Comment 7 Franck Bui 2017-04-24 10:24:36 UTC
(In reply to Thorsten Kukuk from comment #6)
> (In reply to Thomas Blume from comment #5)
> 
> > We need to keep this symlink for backward compatibility.
> > Thorsten, can you please take over?
> 
> Backward compatibility for software, which was written after LSB introduced
> the the LSB SysV init script standard???
> 
> Sorry, please fix systemd that it works on LSB SysV init systems and not
> only on RHEL.

Can you point out the refspec that specifies that symlinks should live in /etc/init.d ?

And that's funny to see how you are very careful to prevent new changes that would break existing tools and in this case you simply ignore existing software that might rely on /etc/rc*.d ...

BTW why did you make this change ? is this a pure cosmetic change or something else ?
Comment 8 Franck Bui 2017-04-26 14:37:45 UTC
Thorsten, I'm reassigning this bug to you.

Please restore the symlink, currently there seems to be no good reason to remove it and it breaks existing tools, most notably systemd.

Thanks.
Comment 9 Thorsten Kukuk 2017-05-02 07:36:11 UTC
*** Bug 1036819 has been marked as a duplicate of this bug. ***
Comment 10 Petr Matula 2017-05-02 12:08:21 UTC
*** Bug 1035609 has been marked as a duplicate of this bug. ***
Comment 11 Patrick Schaaf 2017-05-02 12:18:30 UTC
For the benefit of others currently stuck with the issue - I'm using the following systemd unit as a workaround.

Write the unit file to some unique name, e.g. /etc/systemd/system/workaround-named.service, and then "systemctl daemon-reload" and "systemctl enable workaround-named" as usual for real systemd services.

For services other than named, simply modify the "After=" line.

[Unit]
Description=Named Start Workaround
Requires=multi-user.target named.service
After=named.service
Before=multi-user.target

[Service]
Type=oneshot
ExecStart=/bin/true

[Install]
WantedBy=multi-user.target
Comment 12 Thorsten Kukuk 2017-05-02 12:23:33 UTC
It's a trivial fix for systemd-sysv-convert you need:

--- systemd-sysv-convert        (revision 81277f7f3786474d7a4cf7ed9b820cd3)
+++ systemd-sysv-convert        (working copy)
@@ -39,7 +39,7 @@
 service=$1
 runlevel=$2
 priority=-1
-for l in $(ls /etc/rc.d/rc$runlevel.d/) ; do
+for l in $(ls /etc/init.d/rc$runlevel.d/) ; do
        initscript=$(basename $l)
        if [ ${initscript:0:1} != "S" -o ${initscript:3} != "$service" ]; then
                continue
Comment 13 Thomas Blume 2017-05-03 05:49:41 UTC
(In reply to Thorsten Kukuk from comment #12)
> It's a trivial fix for systemd-sysv-convert you need:

If we do so, I'd suggest to also address this within the systemd package:

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 1b1de43dd..7edb50c80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1430,7 +1430,7 @@ AM_CONDITIONAL(ENABLE_LDCONFIG, [test x$enable_ldconfig = xyes])
 # ------------------------------------------------------------------------------
 # Location of the init scripts as mandated by LSB
 SYSTEM_SYSVINIT_PATH=/etc/init.d
-SYSTEM_SYSVRCND_PATH=/etc/rc.d
+SYSTEM_SYSVRCND_PATH="${SYSTEM_SYSVINIT_PATH}"
 
 AC_ARG_WITH([sysvinit-path],
         [AS_HELP_STRING([--with-sysvinit-path=PATH],
--
Comment 14 Thorsten Kukuk 2017-05-03 07:14:58 UTC
I did (but by using the configure option), only looks like our systemd developers don't like it:
https://build.opensuse.org/request/show/492486
Comment 15 Franck Bui 2017-05-04 07:58:29 UTC
(In reply to Thorsten Kukuk from comment #14)
> I did (but by using the configure option), only looks like our systemd
> developers don't like it:
> https://build.opensuse.org/request/show/492486

The issues are:

 - the goal of killing /etc/rc.d symlink is unclear, and at a first glance
   it looks like a minor cleanup which just takes risk to break stuff for
   no good reasons. The ultimate goal here is rather to get rid of the
   sysv init scripts instead.

 - the main justification of your change is "/etc/rc.d was defined by RH".
   This doesn't seem correct since this path is part of the LSB specficiations.

So currently your change and its justification looks unneeded and incorrect.
Comment 16 Bernhard Wiedemann 2017-05-04 16:01:07 UTC
This is an autogenerated message for OBS integration:
This bug (1035062) was mentioned in
https://build.opensuse.org/request/show/492882 Factory / insserv-compat
Comment 17 Thorsten Kukuk 2017-05-24 09:08:52 UTC
(In reply to Franck Bui from comment #15)

>  - the main justification of your change is "/etc/rc.d was defined by RH".
>    This doesn't seem correct since this path is part of the LSB
> specficiations.

This is not correct. /etc/rc.d is not part of the LSB, it is not part of FHS and the only distribution using it is Red Hat.
Comment 18 Franck Bui 2017-05-24 10:23:43 UTC
(In reply to Thorsten Kukuk from comment #17)
> (In reply to Franck Bui from comment #15)
> 
> >  - the main justification of your change is "/etc/rc.d was defined by RH".
> >    This doesn't seem correct since this path is part of the LSB
> > specficiations.
> 
> This is not correct. /etc/rc.d is not part of the LSB, it is not part of FHS
> and the only distribution using it is Red Hat.

http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/initsrcinstrm.html

Anyways the symlink has been restored.

IMHO, this kind of changes is useless, the ultimate goal is to get rid of the sysv init scripts support entirely, doing such micro optimizations/cleanups that would possibly bring new regressions/bugs seems a waste of time.
Comment 19 Bernhard Wiedemann 2017-06-20 10:01:02 UTC
This is an autogenerated message for OBS integration:
This bug (1035062) was mentioned in
https://build.opensuse.org/request/show/505020 42.3 / insserv-compat
Comment 20 Franck Bui 2017-07-31 13:39:35 UTC
*** Bug 1037012 has been marked as a duplicate of this bug. ***
Comment 21 Swamp Workflow Management 2017-09-04 19:44:34 UTC
SUSE-RU-2017:2345-1: An update that has two recommended fixes can now be installed.

Category: recommended (low)
Bug References: 1035062,944903
CVE References: 
Sources used:
SUSE Linux Enterprise Server for Raspberry Pi 12-SP2 (src):    insserv-compat-0.1-14.3.1
SUSE Linux Enterprise Server 12-SP3 (src):    insserv-compat-0.1-14.3.1
SUSE Linux Enterprise Server 12-SP2 (src):    insserv-compat-0.1-14.3.1
SUSE Linux Enterprise Desktop 12-SP3 (src):    insserv-compat-0.1-14.3.1
SUSE Linux Enterprise Desktop 12-SP2 (src):    insserv-compat-0.1-14.3.1
SUSE Container as a Service Platform ALL (src):    insserv-compat-0.1-14.3.1
OpenStack Cloud Magnum Orchestration 7 (src):    insserv-compat-0.1-14.3.1
Comment 22 Swamp Workflow Management 2017-09-06 04:07:53 UTC
openSUSE-RU-2017:2373-1: An update that has two recommended fixes can now be installed.

Category: recommended (low)
Bug References: 1035062,944903
CVE References: 
Sources used:
openSUSE Leap 42.2 (src):    insserv-compat-0.1-16.3.1
Comment 23 Swamp Workflow Management 2017-09-14 19:15:07 UTC
SUSE-SU-2017:2470-1: An update that solves 18 vulnerabilities and has 46 fixes is now available.

Category: security (important)
Bug References: 1004995,1009745,1014471,1017420,1019637,1026825,1027079,1027688,1027908,1028281,1028723,1029523,1031756,1032706,1033236,1035062,1036659,1038132,1038444,1038984,1042392,1043218,1043333,1044095,1044107,1044175,1044840,1045384,1045735,1045987,1046268,1046417,1046659,1046853,1046858,1047008,1047236,1047240,1047310,1047379,1047785,1047964,1047965,1048315,1048483,1048605,1048679,1048715,1049344,1050396,1050484,1051626,1051643,1051644,1052030,1052759,1053409,874665,902364,938657,944903,954661,960820,963041
CVE References: CVE-2013-7459,CVE-2016-9063,CVE-2017-1000100,CVE-2017-1000101,CVE-2017-10684,CVE-2017-10685,CVE-2017-11112,CVE-2017-11113,CVE-2017-3308,CVE-2017-3309,CVE-2017-3453,CVE-2017-3456,CVE-2017-3464,CVE-2017-7435,CVE-2017-7436,CVE-2017-8872,CVE-2017-9233,CVE-2017-9269
Sources used:
SUSE Container as a Service Platform ALL (src):    caasp-container-manifests-0.0.0+git_r155_93e40ab-2.3.3, container-feeder-0.0.0+20170901.git_r55_17ecbd3-2.3.3, sles12-mariadb-docker-image-1.1.0-2.3.10, sles12-pause-docker-image-1.1.0-2.3.11, sles12-pv-recycler-node-docker-image-1.1.0-2.3.10, sles12-salt-api-docker-image-1.1.0-2.3.9, sles12-salt-master-docker-image-1.1.0-4.3.10, sles12-salt-minion-docker-image-1.1.0-2.3.8, sles12-velum-docker-image-1.1.0-4.3.9