16.04: Graphical login/desktop vanished? (coming closer)

Tom H tomh0665 at gmail.com
Tue Jul 26 13:13:49 UTC 2016


On Tue, Jul 26, 2016 at 7:34 AM, Josef Wolf <jw at raven.inka.de> wrote:


> To sum up: the core of the problem was that on a freshly installed 16.04
>
>   "aptitude -q -y remove network-manager"
>
> did remove the whole graphical desktop. (almost 600 packages)

I'm not using a "standard" DE installation at the moment so I can't
check but it may be that network-manager is a dependency of a task so
removing it triggers the removal of all the packages pulled in by that
task.


> Strange enough, /etc/init.d/lightdm was still there and was actually
> invoked by systemd. Running it by hand did not produce any
> diagnostics. Therefore, I (erronously) assumed lightdm is still there
> but fails to start.
>
> That box was a clean install of 16.04, not an upgrade.
>>
>> I pointed out that something is fishy with the OP's install.
>>
>> 1. lightdm isn't removed
>> 2. /etc/init.d/lightdm is the wrong location, there should be a
>> systemd unit instead
>
> This WAS a fresh install of 16.04.
>
> Lightdm WAS removed.
>
> /etc/init.d/lightdm WAS the correct file name. Actually, it was a shell
> script with start/stop stuff etc. I know for sure, because it was by
> checking this script how I found that it tries to start
> /usr/sbin/lightdm. Only THEN I got the clue that /usr/sbin/lightdm is
> missing and started to investigate why it is missing.

"/etc/init/lightdm.conf", "/etc/init.d/lightdm", and
"/lib/systemd/system/lightdm.service" are all installed by the
"lightdm" package.

lightdm is launched by
- "/lib/systemd/system/lightdm.service" if you're using systemd
- "/etc/init/lightdm.conf" if you're using upstart
- "/etc/init.d/lightdm" if you're using sysvrc (not on Ubuntu)

A possible explanation of "/etc/init.d/lightdm" existing and being run
by systemd even though lightdm's been uninstalled is that
"/etc/init.d/lightdm" is a conffile and
"/lib/systemd/system/lightdm.service" isn't. So, if lightdm isn't
purged, "/etc/init.d/lightdm" can still exist and it'll be run by
systemd (in the absence of "/lib/systemd/system/lightdm.service") -
and presumably fail since "/usr/sbin/lightdm" won't exist.


> Any pointers to how configure NM in a scripted manner?
>
> Do you have a pointer? Maybe this would be a viable interface for
> quering and configuring the network stuff?

You can configure NM in two ways on Debian.

Look at the "plugins" line in the "main" section of
"/etc/Network/NetworkManager.conf".

If it has "ifupdown" (which is there by default on Ubuntu), you can
set "managed=true in the "ifupdown" section and configure your
interface in "/etc/network/interfaces". I've only ever tested/used
this in a VM so I have no idea whether the ifupdown plugin can handle
wpa/bonds/bridges/vlans/etc.

If it has "keyfile" (which is there by default too), you can configure
a connection with a file in "/etc/NetworkManager/system-connections/",
for example on my home laptop:

# cat /etc/NetworkManager/system-connections/tom
[connection]
id=tom
type=802-11-wireless

[802-11-wireless]
ssid=DELETED
mode=infrastructure
security=802-11-wireless-security

[802-11-wireless-security]
key-mgmt=wpa-psk
psk=DELETED

[ipv4]
address1=192.168.1.111/24
dns=192.168.1.253;
gateway=192.168.1.254
method=manual

[ipv6]
method=link-local

"man nm-settings" for all options.

"tom" must have a mode of "0600" and ownership of "root:root".

My preferred NM method is the second one because it works cross-distro.




More information about the ubuntu-users mailing list