Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#757114: systemd-run --user fails

121 views
Skip to first unread message

intrigeri

unread,
Nov 18, 2014, 5:10:04 AM11/18/14
to
Control: tag -1 + moreinfo

Ansgar Burchardt wrote (05 Aug 2014 13:01:22 GMT) :
> trying to use systemd-run --user fails:

> $ systemd-run --user /bin/sleep 3600
> Running as unit run-17508.service.
> Failed start transient unit: Process org.freedesktop.systemd1 exited with status 1

It works fine for me on current sid:

intrige+ 11871 0.0 0.0 5804 660 ? Ss 11:03 0:00 /bin/sleep 3600

Can you still reproduce this bug?

Cheers,
--
intrigeri


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Wang Jian

unread,
Nov 18, 2014, 10:40:03 PM11/18/14
to
Version: 215-5+b1

On Tue, 18 Nov 2014 11:24:46 +0100 Ansgar Burchardt <ans...@debian.org> wrote:
> Version: 215-5
>
> Hi,

>
> On 11/18/2014 11:04 AM, intrigeri wrote:
> > Ansgar Burchardt wrote (05 Aug 2014 13:01:22 GMT) :
> >> trying to use systemd-run --user fails:
> >
> >> $ systemd-run --user /bin/sleep 3600
> >> Running as unit run-17508.service.
> >> Failed start transient unit: Process org.freedesktop.systemd1 exited with status 1
> >
> > It works fine for me on current sid:
> >
> > intrige+ 11871 0.0 0.0 5804 660 ? Ss 11:03 0:00 /bin/sleep 3600
> >
> > Can you still reproduce this bug?
>
> No, systemd-run no longer complains:
>
> ~ % systemd-run --user /bin/sleep 3600
> Running as unit run-855.service.
>
> The sleep process is also running just fine[1].
>
> Ansgar
>
> [1] Minus having transient files in ~/.config/systemd/user; this
> might be fixed in systemd-217 as it has this entry in NEWS:
> "User units are now loaded also from
> $XDG_RUNTIME_DIR/systemd/user/."
>
>

However, here I am struggling with user services. I have 3 jessie hosts,
all rolling upgrade from wheezy (one is a linode VPS).

root@gw:~# su - lark
lark@gw:~$ systemd-run --user /bin/ls
Failed to create bus connection: Connection refused
lark@gw:~$ systemd-run /bin/ls
Failed to create message: Permission denied
lark@gw:~$ systemctl --user status
Failed to get D-Bus connection: Connection refused
lark@gw:~$ exit
logout
root@gw:~# systemd-run --user /bin/ls
Running as unit run-4429.service.

And a simple service unit under ~/.config/systemd/user/ for 
'/bin/sleep 3600' is not started for user 'lark'.

root@gw:~# dpkg -l |grep systemd
ii  libpam-systemd:amd64              215-5+b1                          amd64        system and service manager - PAM module
ii  libsystemd0:amd64                 215-5+b1                          amd64        systemd utility library
ii  systemd                           215-5+b1                          amd64        system and service manager
ii  systemd-sysv                      215-5+b1                          amd64        system and service manager - SysV links


intrigeri

unread,
Nov 19, 2014, 5:10:04 AM11/19/14
to
Hi,

Wang Jian wrote (19 Nov 2014 03:28:40 GMT) :
> However, here I am struggling with user services. I have 3 jessie hosts,
> all rolling upgrade from wheezy (one is a linode VPS).

> root@gw:~# su - lark
> lark@gw:~$ systemd-run --user /bin/ls
> Failed to create bus connection: Connection refused

Do you have a "systemd --user" instance running as the "lark" user?

Do you have a D-Bus daemon running as the "lark" user?

Has your session a valid $DBUS_SESSION_BUS_ADDRESS ?

Does pam-auth-update show "Register user sessions in the systemd
control group hierarchy" as enabled?

Wang Jian

unread,
Nov 19, 2014, 6:40:03 AM11/19/14
to
2014-11-19 18:07 GMT+08:00 intrigeri <intr...@debian.org>:
Hi,

Wang Jian wrote (19 Nov 2014 03:28:40 GMT) :
> However, here I am struggling with user services. I have 3 jessie hosts,
> all rolling upgrade from wheezy (one is a linode VPS).

> root@gw:~# su - lark
> lark@gw:~$ systemd-run --user /bin/ls
> Failed to create bus connection: Connection refused

Do you have a "systemd --user" instance running as the "lark" user?

Yes.
 
# loginctl enable-linger lark
 

Do you have a D-Bus daemon running as the "lark" user?

No.

No dbus daemon running as 'lark'. I did try as


but without success.
 

Has your session a valid $DBUS_SESSION_BUS_ADDRESS ?

No.

I remotely ssh login as root then su - lark.

I guess it's a PAM configuration problem but I am still trying to
understand the whole picture.
 

Does pam-auth-update show "Register user sessions in the systemd
control group hierarchy" as enabled?

Yes.
 
My use case is a little special. I want to use it to replace daemontools-run, to
run services of  normal privilege on the servers, not for this single user.

Wang Jian

unread,
Nov 19, 2014, 8:50:04 AM11/19/14
to
intrigeri,

It works if I login as 'lark'. So my situation is not related this bug.

'su - <username>' or 'sudo -i -u <username>' is not a new systemd session. I
can confirm this by checking cgroup

$ cat /proc/$$/cgroup

This may or may not be another bug or mis-configuration of default installation.

Thanks for your help.

Wang Jian

unread,
Nov 19, 2014, 9:40:02 AM11/19/14
to

Andrei POPESCU

unread,
Nov 19, 2014, 1:20:05 PM11/19/14
to
On Mi, 19 nov 14, 19:32:51, Wang Jian wrote:
>
> My use case is a little special. I want to use it to replace
> daemontools-run, to
> run services of normal privilege on the servers, not for this single user.

Could you please elaborate on this? The recommended way to start
*system* services as another user is via the User= and Group= directives
in the unit files.

A 'systemd --user' instance is rather meant for individual users to run
their own services (e.g. I use it to run imapfilter).

Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt
signature.asc

Wang Jian

unread,
Nov 19, 2014, 3:00:04 PM11/19/14
to


2014年11月20日 02:12于 "Andrei POPESCU" <andreim...@gmail.com>写道:
>
> On Mi, 19 nov 14, 19:32:51, Wang Jian wrote:
> >
> > My use case is a little special. I want to use it to replace
> > daemontools-run, to
> > run services of  normal privilege on the servers, not for this single user.
>
> Could you please elaborate on this? The recommended way to start
> *system* services as another user is via the User= and Group= directives
> in the unit files.

Only root can configure this, not convenient for devs.

>
> A 'systemd --user' instance is rather meant for individual users to run
> their own services (e.g. I use it to run imapfilter).

But not limited to this. For example, you can run web application server under  deployment account. Devs can do whatever they want, in more secure and
powerful way.

Andrei POPESCU

unread,
Nov 19, 2014, 3:20:03 PM11/19/14
to
On Jo, 20 nov 14, 03:55:59, Wang Jian wrote:
> 2014年11月20日 02:12于 "Andrei POPESCU" <andreim...@gmail.com>写道:
> >
> > A 'systemd --user' instance is rather meant for individual users to run
> > their own services (e.g. I use it to run imapfilter).
>
> But not limited to this. For example, you can run web application server
> under deployment account. Devs can do whatever they want, in more secure
> and
> powerful way.

Oh, sure, feel free to scratch the "individual" in my comment above ;)
signature.asc
0 new messages