New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start-up script `/etc/init.d/ka-lite` does not get added to default runlevels #440

Closed
benjaoming opened this Issue Feb 20, 2017 · 5 comments

Comments

Projects
None yet
1 participant
@benjaoming
Member

benjaoming commented Feb 20, 2017

Summary

I haven't verified this issue on Debian, but on the latest Raspbian based on Debian Jessie, the start-up script does not run at bootup.

Running sudo update-rc.d ka-lite defaults has no effects, apparently the old script is a noop.

Workaround

Non at the moment...

Version

Any .deb installer on Raspbian.

Traceback

root@raspberrypi:~# /etc/rc3.d/S02ka-lite status
● S02ka-lite.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

@benjaoming benjaoming self-assigned this Feb 20, 2017

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Mar 30, 2017

Member

This was also reported in learningequality/ka-lite#5423

0.17.0-0ubuntu2 is available in the ka-lite-proposed PPA: https://launchpad.net/~learningequality/+archive/ubuntu/ka-lite-proposed

Member

benjaoming commented Mar 30, 2017

This was also reported in learningequality/ka-lite#5423

0.17.0-0ubuntu2 is available in the ka-lite-proposed PPA: https://launchpad.net/~learningequality/+archive/ubuntu/ka-lite-proposed

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming May 3, 2017

Member

Confirmed on Ubuntu 16.10

While systemd script is running systemctl start ka-lite just fine, the links created by update-rc.d do not seem to start.

The startup links are created correctly:

# ...
lrwxrwxrwx 1 root root 21 May  2 17:03 S01grub-common -> ../init.d/grub-common
lrwxrwxrwx 1 root root 20 May  2 17:03 S01irqbalance -> ../init.d/irqbalance
lrwxrwxrwx 1 root root 17 May  3 12:08 S01ka-lite -> ../init.d/ka-lite

But again, something is wrong with the systemd compatibility:

root@kalite-VirtualBox:~# /etc/rc3.d/S01ka-lite status
Unit S01ka-lite.service could not be found.

Running the script directly from /etc/init.d/ka-lite seems to work, so it could be that somehow our script or systemd doesn't like the symlink:

root@kalite-VirtualBox:~# /etc/init.d/ka-lite status
● ka-lite.service - LSB: ka-lite daemon, a local Khan Academy content server
   Loaded: loaded (/etc/init.d/ka-lite; static; vendor preset: enabled)
   Active: active (exited) since Wed 2017-05-03 14:31:29 CEST; 3min 7s ago

May 03 14:31:25 kalite-VirtualBox systemd[1]: Starting LSB: ka-lite daemon, ....
May 03 14:31:25 kalite-VirtualBox su[2722]: Successful su for kalite by root
May 03 14:31:25 kalite-VirtualBox su[2722]: + ??? root:kalite
May 03 14:31:25 kalite-VirtualBox su[2722]: pam_unix(su:session): session op...)
May 03 14:31:29 kalite-VirtualBox ka-lite[2714]: Running 'kalite start' as d...)
May 03 14:31:29 kalite-VirtualBox ka-lite[2714]: Stand by while the server l....
May 03 14:31:29 kalite-VirtualBox ka-lite[2714]: Going to daemon mode, loggi...g
May 03 14:31:29 kalite-VirtualBox systemd[1]: Started LSB: ka-lite daemon, a....
Hint: Some lines were ellipsized, use -l to show in full.
Member

benjaoming commented May 3, 2017

Confirmed on Ubuntu 16.10

While systemd script is running systemctl start ka-lite just fine, the links created by update-rc.d do not seem to start.

The startup links are created correctly:

# ...
lrwxrwxrwx 1 root root 21 May  2 17:03 S01grub-common -> ../init.d/grub-common
lrwxrwxrwx 1 root root 20 May  2 17:03 S01irqbalance -> ../init.d/irqbalance
lrwxrwxrwx 1 root root 17 May  3 12:08 S01ka-lite -> ../init.d/ka-lite

But again, something is wrong with the systemd compatibility:

root@kalite-VirtualBox:~# /etc/rc3.d/S01ka-lite status
Unit S01ka-lite.service could not be found.

Running the script directly from /etc/init.d/ka-lite seems to work, so it could be that somehow our script or systemd doesn't like the symlink:

root@kalite-VirtualBox:~# /etc/init.d/ka-lite status
● ka-lite.service - LSB: ka-lite daemon, a local Khan Academy content server
   Loaded: loaded (/etc/init.d/ka-lite; static; vendor preset: enabled)
   Active: active (exited) since Wed 2017-05-03 14:31:29 CEST; 3min 7s ago

May 03 14:31:25 kalite-VirtualBox systemd[1]: Starting LSB: ka-lite daemon, ....
May 03 14:31:25 kalite-VirtualBox su[2722]: Successful su for kalite by root
May 03 14:31:25 kalite-VirtualBox su[2722]: + ??? root:kalite
May 03 14:31:25 kalite-VirtualBox su[2722]: pam_unix(su:session): session op...)
May 03 14:31:29 kalite-VirtualBox ka-lite[2714]: Running 'kalite start' as d...)
May 03 14:31:29 kalite-VirtualBox ka-lite[2714]: Stand by while the server l....
May 03 14:31:29 kalite-VirtualBox ka-lite[2714]: Going to daemon mode, loggi...g
May 03 14:31:29 kalite-VirtualBox systemd[1]: Started LSB: ka-lite daemon, a....
Hint: Some lines were ellipsized, use -l to show in full.
@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming May 3, 2017

Member

Seems like the problem could be a missing WantedBy section. We need to retain backwards compatibility so replacing update-rc.d with systemctl enable is not the entire solution...

# systemctl enable ka-lite.service
Synchronizing state of ka-lite.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ka-lite
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.
Member

benjaoming commented May 3, 2017

Seems like the problem could be a missing WantedBy section. We need to retain backwards compatibility so replacing update-rc.d with systemctl enable is not the entire solution...

# systemctl enable ka-lite.service
Synchronizing state of ka-lite.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ka-lite
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.
@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming May 3, 2017

Member

Adding the following to the system.d service script work with systemctl enable...

[Install]
WantedBy=default.target

Failure of update-rc.d ka-lite defaults on Ubuntu 16.04:

sudo /etc/rc3.d/K01ka-lite start
[....] Starting K01ka-lite (via systemctl): K01ka-lite.serviceFailed to start K01ka-lite.service: Unit K01ka-lite.service not found.
 failed!

...however since update-rc.d ka-lite defaults adds broken commands, we will have to issue both commands, regardless of whether they succeed (systemctl isn't available on 14.04).

Member

benjaoming commented May 3, 2017

Adding the following to the system.d service script work with systemctl enable...

[Install]
WantedBy=default.target

Failure of update-rc.d ka-lite defaults on Ubuntu 16.04:

sudo /etc/rc3.d/K01ka-lite start
[....] Starting K01ka-lite (via systemctl): K01ka-lite.serviceFailed to start K01ka-lite.service: Unit K01ka-lite.service not found.
 failed!

...however since update-rc.d ka-lite defaults adds broken commands, we will have to issue both commands, regardless of whether they succeed (systemctl isn't available on 14.04).

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming May 5, 2017

Member

Fixed in #450 - releases in 0.17.1

Member

benjaoming commented May 5, 2017

Fixed in #450 - releases in 0.17.1

@benjaoming benjaoming closed this May 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment