After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766330 - server: Add a way for Vino to be started via user systemd
server: Add a way for Vino to be started via user systemd
Status: RESOLVED FIXED
Product: vino
Classification: Applications
Component: Server
unspecified
Other All
: Normal normal
: ---
Assigned To: Vino Maintainer(s)
Vino Maintainer(s)
Depends on:
Blocks: 766329
 
 
Reported: 2016-05-12 14:01 UTC by Bastien Nocera
Modified: 2016-09-05 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
server: Add a way for Vino to be started via user systemd (2.90 KB, patch)
2016-05-12 14:01 UTC, Bastien Nocera
none Details | Review
server: Add a way for Vino to be started via user systemd (2.90 KB, patch)
2016-05-12 16:21 UTC, Bastien Nocera
none Details | Review
server: Add a way for Vino to be started via user systemd (3.12 KB, patch)
2016-05-13 08:47 UTC, Bastien Nocera
none Details | Review
server: Add a way for Vino to be started via user systemd (3.28 KB, patch)
2016-08-30 10:53 UTC, Bastien Nocera
committed Details | Review
build: Use AM_DISTCHECK_CONFIGURE_FLAGS (740 bytes, patch)
2016-08-30 10:53 UTC, Bastien Nocera
committed Details | Review
build: fix syntax error (vino) (858 bytes, patch)
2016-08-31 11:46 UTC, Alberts Muktupāvels
committed Details | Review
build: fix syntax error (gnome-user-share) (890 bytes, patch)
2016-08-31 11:47 UTC, Alberts Muktupāvels
none Details | Review

Description Bastien Nocera 2016-05-12 14:01:05 UTC
.
Comment 1 Bastien Nocera 2016-05-12 14:01:09 UTC
Created attachment 327713 [details] [review]
server: Add a way for Vino to be started via user systemd

This will allow better tracking of whether vino is running, ensuring
that even if the manager to enable/disable its startup
(gnome-settings-daemon) crashes and needs to restart, its status is
still available by querying the user systemd.
Comment 2 David King 2016-05-12 14:11:08 UTC
Review of attachment 327713 [details] [review]:

Seems fine to me.
Comment 3 Giovanni Campagna 2016-05-12 16:17:09 UTC
Review of attachment 327713 [details] [review]:

::: server/vino-server.service.in
@@ +5,3 @@
+Type=dbus
+BusName=org.gnome.Vino
+ExecStart=@libexecdir@/rygel

This does not seem right
Comment 4 Bastien Nocera 2016-05-12 16:21:12 UTC
Created attachment 327723 [details] [review]
server: Add a way for Vino to be started via user systemd

This will allow better tracking of whether vino is running, ensuring
that even if the manager to enable/disable its startup
(gnome-settings-daemon) crashes and needs to restart, its status is
still available by querying the user systemd.
Comment 5 Bastien Nocera 2016-05-12 16:22:21 UTC
(In reply to Giovanni Campagna from comment #3)
> Review of attachment 327713 [details] [review] [review]:
> 
> ::: server/vino-server.service.in
> @@ +5,3 @@
> +Type=dbus
> +BusName=org.gnome.Vino
> +ExecStart=@libexecdir@/rygel
> 
> This does not seem right

Indeed. Shows that 1) I didn't test all those changes yet, but am planning to before committing 2) Where the cut'n'paste came from ;)
Comment 6 David King 2016-05-13 04:18:26 UTC
Review of attachment 327723 [details] [review]:

Seems fine.
Comment 7 Bastien Nocera 2016-05-13 08:47:25 UTC
Created attachment 327765 [details] [review]
server: Add a way for Vino to be started via user systemd

This will allow better tracking of whether vino is running, ensuring
that even if the manager to enable/disable its startup
(gnome-settings-daemon) crashes and needs to restart, its status is
still available by querying the user systemd.
Comment 8 David King 2016-05-13 09:02:09 UTC
Review of attachment 327765 [details] [review]:

::: Makefile.am
@@ +316,3 @@
 MAINTAINERCLEANFILES = $(gsettings_SCHEMAS:.xml=.valid)
 
+DISTCHECK_CONFIGURE_FLAGS = --with-systemduserunitdir='$${libdir}/systemd/user-distcheck'

If this is necessary for distcheck to succeed, it should be AM_DISTCHECK_CONFIGURE_FLAGS (a developer/maintainer option), not DISTCHECK_CONFIGURE_FLAGS (which is reserved for the consumer):

https://www.gnu.org/software/automake/manual/automake.html
Comment 9 Ray Strode [halfline] 2016-07-28 15:39:04 UTC
Review of attachment 327765 [details] [review]:

::: configure.ac
@@ +270,3 @@
+	    AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
+	    [],
+	    [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)])

maybe before calling $PKG_CONFIG directly there should be a check first like PKG_CHECK_EXISTS (systemd, , AC_MSG_ERROR ([systemd development headers not found])) so it errors out more cleanly ?

::: server/vino-server.service.in
@@ +1,2 @@
+[Unit]
+Description=Vino VNC server

So there were some recent changes to how systemd --user targets are laid out.  see https://github.com/systemd/systemd/commit/c92fcc4f4375b0aebc5919311bbf703138b21918

I wonder if we should put PartOf=graphical-session.target so vino is automatically killed if the session ends.  Downside is it ties us to an unreleased systemd, so maybe skip for now. just food for thought.

@@ +3,3 @@
+
+[Service]
+Type=dbus

if you're going to make this type dbus then you need to change the dbus service file to map to the systemd service file using SystemdService=vino=server.service .  Also, by convention the Exec line is normally changed to /bin/false in the dbus service file to make it clear its no longer used.
Comment 10 Bastien Nocera 2016-08-30 10:52:51 UTC
(In reply to Ray Strode [halfline] from comment #9)
> Review of attachment 327765 [details] [review] [review]:
> 
> ::: configure.ac
> @@ +270,3 @@
> +	    AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd
> user service files]),
> +	    [],
> +	    [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir
> systemd)])
> 
> maybe before calling $PKG_CONFIG directly there should be a check first like
> PKG_CHECK_EXISTS (systemd, , AC_MSG_ERROR ([systemd development headers not
> found])) so it errors out more cleanly ?

Fixed. We can make this better in a separate patch.

> ::: server/vino-server.service.in
> @@ +1,2 @@
> +[Unit]
> +Description=Vino VNC server
> 
> So there were some recent changes to how systemd --user targets are laid
> out.  see
> https://github.com/systemd/systemd/commit/
> c92fcc4f4375b0aebc5919311bbf703138b21918
> 
> I wonder if we should put PartOf=graphical-session.target so vino is
> automatically killed if the session ends.  Downside is it ties us to an
> unreleased systemd, so maybe skip for now. just food for thought.

Made a note, and will file bugs for that as well.

> @@ +3,3 @@
> +
> +[Service]
> +Type=dbus
> 
> if you're going to make this type dbus then you need to change the dbus
> service file to map to the systemd service file using
> SystemdService=vino=server.service .  Also, by convention the Exec line is
> normally changed to /bin/false in the dbus service file to make it clear its
> no longer used.

There's no D-Bus service file for vino, it's not autostartable.

I also fixed the duplicated DISTCHECK_CONFIGURE_FLAGS.
Comment 11 Bastien Nocera 2016-08-30 10:53:22 UTC
Created attachment 334428 [details] [review]
server: Add a way for Vino to be started via user systemd

This will allow better tracking of whether vino is running, ensuring
that even if the manager to enable/disable its startup
(gnome-settings-daemon) crashes and needs to restart, its status is
still available by querying the user systemd.
Comment 12 Bastien Nocera 2016-08-30 10:53:29 UTC
Created attachment 334429 [details] [review]
build: Use AM_DISTCHECK_CONFIGURE_FLAGS

And not DISTCHECK_CONFIGURE_FLAGS, as it is a developer/maintainer
option, not a user option.
Comment 13 Bastien Nocera 2016-08-30 10:54:02 UTC
Attachment 334428 [details] pushed as 27785a2 - server: Add a way for Vino to be started via user systemd
Attachment 334429 [details] pushed as b1d968e - build: Use AM_DISTCHECK_CONFIGURE_FLAGS
Comment 14 Alberts Muktupāvels 2016-08-31 11:46:32 UTC
Created attachment 334524 [details] [review]
build: fix syntax error (vino)

Patch to fix this error:
./configure: line 15051: syntax error near unexpected token `('
./configure: line 15051: `fi (systemd,, as_fn_error $? "" "$LINENO" 5 (systemd development headers not found))'
Comment 15 Alberts Muktupāvels 2016-08-31 11:47:07 UTC
Created attachment 334525 [details] [review]
build: fix syntax error (gnome-user-share)

Patch for same error.
Comment 16 Alberts Muktupāvels 2016-08-31 11:48:45 UTC
Configure fails with syntax error after 27785a2 commit.
Comment 17 Ting-Wei Lan 2016-09-05 10:46:20 UTC
This causes vino to fail to configure when systemd is not available. Can we add an option to allow building vino on non-Linux systems?

configure: error: systemd development headers not found
Comment 18 David King 2016-09-05 10:52:01 UTC
Already covered by bug 770759.