GUACAMOLE-30: Implement systemd script for guacd
This commit is contained in:
parent
344ed4f42e
commit
77cac3b30d
15
configure.ac
15
configure.ac
@ -148,6 +148,14 @@ AC_ARG_WITH(init_dir,
|
|||||||
AM_CONDITIONAL([ENABLE_INIT], [test "x${init_dir}" != "x"])
|
AM_CONDITIONAL([ENABLE_INIT], [test "x${init_dir}" != "x"])
|
||||||
AC_SUBST(init_dir)
|
AC_SUBST(init_dir)
|
||||||
|
|
||||||
|
# Systemd directory
|
||||||
|
AC_ARG_WITH(systemd_dir,
|
||||||
|
[AS_HELP_STRING([--with-systemd-dir=<path>],
|
||||||
|
[install systemd units to the given directory])
|
||||||
|
],systemd_dir=$withval)
|
||||||
|
AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x${systemd_dir}" != "x"])
|
||||||
|
AC_SUBST(systemd_dir)
|
||||||
|
|
||||||
# guacd config file
|
# guacd config file
|
||||||
AC_ARG_WITH(guacd_conf,
|
AC_ARG_WITH(guacd_conf,
|
||||||
[AS_HELP_STRING([--with-guacd-conf=<path>],
|
[AS_HELP_STRING([--with-guacd-conf=<path>],
|
||||||
@ -1251,6 +1259,12 @@ AM_COND_IF([ENABLE_GUACLOG], [build_guaclog=yes], [build_guaclog=no])
|
|||||||
|
|
||||||
AM_COND_IF([ENABLE_INIT], [build_init="${init_dir}"], [build_init=no])
|
AM_COND_IF([ENABLE_INIT], [build_init="${init_dir}"], [build_init=no])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Systemd units
|
||||||
|
#
|
||||||
|
|
||||||
|
AM_COND_IF([ENABLE_SYSTEMD], [build_systemd="${systemd_dir}"], [build_systemd=no])
|
||||||
|
|
||||||
#
|
#
|
||||||
# Display summary
|
# Display summary
|
||||||
#
|
#
|
||||||
@ -1290,6 +1304,7 @@ $PACKAGE_NAME version $PACKAGE_VERSION
|
|||||||
guaclog .... ${build_guaclog}
|
guaclog .... ${build_guaclog}
|
||||||
|
|
||||||
Init scripts: ${build_init}
|
Init scripts: ${build_init}
|
||||||
|
Systemd units: ${build_systemd}
|
||||||
|
|
||||||
Type \"make\" to compile $PACKAGE_NAME.
|
Type \"make\" to compile $PACKAGE_NAME.
|
||||||
"
|
"
|
||||||
|
3
src/guacd/.gitignore
vendored
3
src/guacd/.gitignore
vendored
@ -2,6 +2,9 @@
|
|||||||
# Compiled init script
|
# Compiled init script
|
||||||
init.d/guacd
|
init.d/guacd
|
||||||
|
|
||||||
|
# Compiled systemd unit
|
||||||
|
systemd/guacd.service
|
||||||
|
|
||||||
# Compiled proxy
|
# Compiled proxy
|
||||||
guacd
|
guacd
|
||||||
guacd.exe
|
guacd.exe
|
||||||
|
@ -61,11 +61,12 @@ guacd_LDFLAGS = \
|
|||||||
@SSL_LIBS@
|
@SSL_LIBS@
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
init.d/guacd.in \
|
init.d/guacd.in \
|
||||||
man/guacd.8.in \
|
systemd/guacd.service.in \
|
||||||
|
man/guacd.8.in \
|
||||||
man/guacd.conf.5.in
|
man/guacd.conf.5.in
|
||||||
|
|
||||||
CLEANFILES = $(init_SCRIPTS)
|
CLEANFILES = $(init_SCRIPTS) $(systemd_UNITS)
|
||||||
|
|
||||||
# Init script
|
# Init script
|
||||||
if ENABLE_INIT
|
if ENABLE_INIT
|
||||||
@ -77,3 +78,12 @@ init.d/guacd: init.d/guacd.in
|
|||||||
chmod +x init.d/guacd
|
chmod +x init.d/guacd
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Systemd service
|
||||||
|
if ENABLE_SYSTEMD
|
||||||
|
systemddir = @systemd_dir@
|
||||||
|
systemd_SCRIPTS = systemd/guacd.service
|
||||||
|
|
||||||
|
systemd/guacd.service: systemd/guacd.service.in
|
||||||
|
sed -e 's,[@]sbindir[@],$(sbindir),g' < systemd/guacd.service.in > systemd/guacd.service
|
||||||
|
endif
|
||||||
|
|
||||||
|
11
src/guacd/systemd/guacd.service.in
Normal file
11
src/guacd/systemd/guacd.service.in
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Guacamole Server
|
||||||
|
Documentation=man:guacd(8)
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=daemon
|
||||||
|
ExecStart=@sbindir@/guacd -f
|
||||||
|
Restart=on-abnormal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user