From 230dc1bc8cf1367eef49df9efdfbfe35eed3eaad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iago=20L=C3=B3pez=20Galeiras?= Date: Mon, 18 May 2015 10:30:31 +0200 Subject: [PATCH] stage1: dlopen libsystemd instead of libsystemd-login In systemd-209 libsystemd-login was merged into libsystemd and a compatibility libsystemd-login library was created. Unfortunately, distributions like Fedora don't ship the compatibility libraries so runningFromUnitFile will always return false. Fix it by dlopening libsystemd.so instead of libsystemd-login.so. --- stage1/init/init.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stage1/init/init.go b/stage1/init/init.go index a7a8f3a..1c9e1f3 100644 --- a/stage1/init/init.go +++ b/stage1/init/init.go @@ -369,16 +369,16 @@ func stage1() int { } func runningFromUnitFile() (ret bool, err error) { - handle := C.dlopen(C.CString("libsystemd-login.so"), C.RTLD_LAZY) + handle := C.dlopen(C.CString("libsystemd.so"), C.RTLD_LAZY) if handle == nil { - // we can't open libsystemd-login.so so we assume systemd is not + // we can't open libsystemd.so so we assume systemd is not // installed and we're not running from a unit file ret = false return } defer func() { if r := C.dlclose(handle); r != 0 { - err = fmt.Errorf("error closing libsystemd-login.so") + err = fmt.Errorf("error closing libsystemd.so") } }()