[shellinabox] Split options in the daemon config file
Simone Caronni
slaanesh at fedoraproject.org
Thu Sep 13 09:13:46 UTC 2012
commit 4144dd00aa4d7f91af960166c082b3c1442d8a6d
Author: Simone Caronni <negativo17 at gmail.com>
Date: Thu Sep 13 11:13:39 2012 +0200
Split options in the daemon config file
shellinabox.spec | 1 +
shellinaboxd.init | 4 +---
shellinaboxd.service | 2 +-
shellinaboxd.sysconfig | 19 ++++++++++++-------
4 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/shellinabox.spec b/shellinabox.spec
index cd1b2ad..4484c31 100644
--- a/shellinabox.spec
+++ b/shellinabox.spec
@@ -170,6 +170,7 @@ exit 0
Set menu item to turn off ssl as disabled by default.
Do not remove user on uninstall.
- Simplified spec file.
+- Split options in the daemon config file.
* Tue Sep 12 2012 Simone Caronni <negativo17 at gmail.com> - 2.14-9
- Added user/group and confined directory for certificates, based on work from Joel Young.
diff --git a/shellinaboxd.init b/shellinaboxd.init
index 9aa5c20..bed1597 100644
--- a/shellinaboxd.init
+++ b/shellinaboxd.init
@@ -20,13 +20,11 @@ if [ -f /etc/sysconfig/$prog ] ; then
. /etc/sysconfig/$prog
fi
-OPTS="$OPTS --background=/var/run/$prog.pid"
-
start() {
[ "$EUID" != "0" ] && exit 4
echo -n "Starting $prog: "
- daemon $prog $OPTS
+ daemon $prog -u $USER -g $GROUP --certdir=$CERTDIR --port=$PORT --background=/var/run/$prog.pid $OPTS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
diff --git a/shellinaboxd.service b/shellinaboxd.service
index f497d98..9fde66d 100644
--- a/shellinaboxd.service
+++ b/shellinaboxd.service
@@ -6,7 +6,7 @@ After=network.target nss-lookup.target
[Service]
EnvironmentFile=-/etc/sysconfig/shellinaboxd
-ExecStart=/usr/sbin/shellinaboxd $OPTS
+ExecStart=/usr/sbin/shellinaboxd -u $USER -g $GROUP --certdir=$CERTDIR --port=$PORT $OPTS
Restart=always
[Install]
diff --git a/shellinaboxd.sysconfig b/shellinaboxd.sysconfig
index 039b525..0587cd3 100644
--- a/shellinaboxd.sysconfig
+++ b/shellinaboxd.sysconfig
@@ -1,13 +1,18 @@
# Shell in a box daemon configuration
# For details see shellinaboxd man page
-# Basic configuration running on port 4200
-OPTS="--cert=/var/run/shellinabox --disable-ssl-menu -u shellinabox -g shellinabox -s /:LOGIN"
+# Basic options
+USER=shellinabox
+GROUP=shellinabox
+CERTDIR=/var/run/shellinabox
+PORT=4200
+OPTS="--disable-ssl-menu -s /:LOGIN"
-# Examples:
-# Fancy configuration with right-click menu choice for black-on-white and running on port 443
-# OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --port=443 --disable-ssl-menu --cert=/var/run/shellinabox -u shellinabox -g shellinabox -s /:LOGIN"
+# Additional examples with custom options:
-# Simple configuration for running it as an SSH console with SSL disabled
-# OPTS="--cert=/var/run/shellinabox -u shellinabox -g shellinabox -t -s /:SSH:host.example.com"
+# Fancy configuration with right-click menu choice for black-on-white:
+# OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN"
+
+# Simple configuration for running it as an SSH console with SSL disabled:
+# OPTS="-t -s /:SSH:host.example.com"
More information about the scm-commits
mailing list