rick Posted October 9, 2016 Posted October 9, 2016 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 lightdmSynchronizing state of lightdm.service with SysV init with /lib/systemd/systemd-sysv-install...Executing /lib/systemd/systemd-sysv-install disable lightdminsserv: 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 lightdmSynchronizing state of lightdm.service with SysV init with /lib/systemd/systemd-sysv-install...Executing /lib/systemd/systemd-sysv-install enable lightdminsserv: 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.serviceto enable:systemctl set-default graphical.target ; systemctl restart lightdm.service Don't know why this way works, it came from a Google search.
Recommended Posts