How to by pass systmed with init.d scripts

Is there a way to stop/prevent the system from redirecting an init.d script to systemctl ?

I have seen 2 possibilities for other distros but neither seem to work for SLES 12.

SYSTEMD_NO_WRAP=1
_SYSTEMCTL_SKIP_REDIRECT=true

Is there one specific for SLES 12 ?

Hi cisaksen,

[QUOTE=cisaksen;29613]Is there a way to stop/prevent the system from redirecting an init.d script to systemctl ?

I have seen 2 possibilities for other distros but neither seem to work for SLES 12.

SYSTEMD_NO_WRAP=1
_SYSTEMCTL_SKIP_REDIRECT=true

Is there one specific for SLES 12 ?[/QUOTE]

Using SYSTEMD_NO_WRAP should work for proper rc files. From /etc/rc.status:

# Check if the service is used under systemd but not started with if test -z "$SYSTEMD_NO_WRAP" && /usr/bin/mountpoint -q /sys/fs/cgroup/systemd; then ...

Regards,
Jens

When I run service mysql bootstrap I get the results from case “$1” in from rc.status code

Background: I’m trying to setup a Galera MariaDB Cluster.

I’m getting the init.d script to work when I run it this way: /etc/init.d/mysql bootstrap bootstrap is a option in the init.d script.

Hi
Just write a simple systemd service file and pop
it into /etc/systemd/system calling the init script with start and stop
lines…?


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.44-52.10-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below… Thanks!

Hi cisaksen,

[QUOTE=cisaksen;29617]When I run service mysql bootstrap I get the results from case “$1” in from rc.status code

Background: I’m trying to setup a Galera MariaDB Cluster.

I’m getting the init.d script to work when I run it this way: /etc/init.d/mysql bootstrap bootstrap is a option in the init.d script.[/QUOTE]

if I understand you correctly, you’re saying that calling “service mysql bootstrap” does forward to systemd, but the parameter “bootstrap” isn’t forwarded to the actual script? That’d be conforming to the man page:

[QUOTE]service SERVICE ACTION [OPTIONS]
[…]
The SERVICE parameter specifies a systemd service name to operate on. The supported values of ACTION depend on the specified service. The actions start, stop, reload, restart, try-restart, force-reload, and status are
forwarded to systemctl, OPTIONS are ignored in that case. Other actions may be defined in /usr/lib/initscripts/legacy-actions. Legacy actions are called directly and OPTIONS are passed on the command line.(QUOTE]

I guess you have not created /usr/lib/initscripts/legacy-actions/mysql/bootstrap as a script to invoke /etc/init.d/mysql bootstrap after setting SYSTEMD_NO_WRAP :wink:

Regards,
Jens

Regards,
Jens

Yea didn’t know about the /usr/lib/initscripts/legacy-actions/ so no nothing there. So I would create the mysql folder and add a bootstrap script underneath. That script executes the appropriate commands based on what’s in the original init.d script. ? Or is it easier than that ? Simply copy the init.d script to /usr/lib/initscripts/legacy-actions/mysql and rename it bootstrap ?

Thanks you your help.

Hi cisaksen,

RTFM :wink:

That most likely won’t work - as the script will be called without the parameter (AFAIK). So as I wrote: Call “/etc/init.d/mysqld bootstrap”, and perhaps circumvent having that script call systemd again. Although the later should not really be necessary, since the redirect code will not catch on the “bootstrap” operation.

There should be a sample implementation for ntp (unless you have not ntpd installed) in those directories.

Regards,
Jens