Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-1981: Add configure argument for systemd user #543

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ AC_ARG_WITH(systemd_dir,
AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x${systemd_dir}" != "x"])
AC_SUBST(systemd_dir)

# Systemd user
AC_ARG_WITH(systemd_user,
[AS_HELP_STRING([--with-systemd-user=<username>],
[the user configured in the systemd unit to run guacd @<:@default=daemon@:>@])],
[systemd_user=$withval],
[systemd_user=daemon])
AC_SUBST(systemd_user)

# guacd config file
AC_ARG_WITH(guacd_conf,
[AS_HELP_STRING([--with-guacd-conf=<path>],
Expand Down Expand Up @@ -1480,6 +1488,7 @@ AM_COND_IF([ENABLE_INIT], [build_init="${init_dir}"], [build_init=no])
#

AM_COND_IF([ENABLE_SYSTEMD], [build_systemd="${systemd_dir}"], [build_systemd=no])
AM_COND_IF([ENABLE_SYSTEMD], [build_systemd_user="${systemd_user}"], [build_systemd_user=no])

#
# FreeRDP plugins
Expand Down Expand Up @@ -1531,6 +1540,7 @@ $PACKAGE_NAME version $PACKAGE_VERSION
FreeRDP plugins: ${build_rdp_plugins}
Init scripts: ${build_init}
Systemd units: ${build_systemd}
Systemd user: ${build_systemd_user}

Type \"make\" to compile $PACKAGE_NAME.
"
5 changes: 4 additions & 1 deletion src/guacd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ endif
# Systemd service
if ENABLE_SYSTEMD
systemddir = @systemd_dir@
systemduser = @systemd_user@
systemd_DATA = systemd/guacd.service

systemd/guacd.service: systemd/guacd.service.in
sed -e 's,[@]sbindir[@],$(sbindir),g' < systemd/guacd.service.in > systemd/guacd.service
sed -e 's,[@]sbindir[@],$(sbindir),g' \
-e 's,[@]systemduser[@],$(systemduser),g' \
< systemd/guacd.service.in > systemd/guacd.service
endif

2 changes: 1 addition & 1 deletion src/guacd/systemd/guacd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Documentation=man:guacd(8)
After=network.target

[Service]
User=daemon
User=@systemduser@
ExecStart=@sbindir@/guacd -f
Restart=on-abnormal

Expand Down
Loading