Jump to content

Recommended Posts

Posted

I am trying to make a pair of scripts, guiup & guidown, that will disable/enable the gui at boot and start/stop it now.

 

"systemctl [stop/start] lightdm.service" works for doing it now, but "systemctl [disable/enable] lightdm.service" does not work as expected.

 

Systemctl disable does work, but then when I enable it again and reboot, lightdm does not come up. Some clues maybe  :

 

root@bananapim2:~# systemctl disable lightdm
Synchronizing state of lightdm.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install disable lightdm
insserv: warning: current start runlevel(s) (empty) of script `lightdm' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `lightdm' overrides LSB defaults (0 1 6).
Removed symlink /etc/systemd/system/display-manager.service.
root@bananapim2:~# systemctl enable lightdm
Synchronizing state of lightdm.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable lightdm
insserv: warning: current start runlevel(s) (empty) of script `lightdm' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `lightdm' overrides LSB defaults (0 1 6).
root@bananapim2:~# reboot
 

 

So it reboots and no gui. Should systemctl disable/enable not be symetrical?

 

To fix it: "apt-get install --reinstall lightdm"

 

so 1) why does this not work? Is it a bug that needs tending 2) Is there a preferred/better way to toggle gui at boot?

 

 

Is there a proper mothod? I have found a working method:

to disable:
sudo systemctl set-default multi-user.target ; sudo systemctl stop lightdm.service

to enable:
systemctl set-default graphical.target ; systemctl restart lightdm.service
 

Don't know why this way works, it came from a Google search.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines