mirror of
https://github.com/clearlinux/rkt.git
synced 2026-08-20 22:17:54 +00:00
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.
This commit is contained in:
+3
-3
@@ -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")
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user