1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-12-04 14:46:37 -05:00

Move configuration from systemd unit file to separate enviroment file

This commit is contained in:
Kim Holviala 2015-12-30 12:32:41 +02:00
parent b1963aeea5
commit 989db4a482
4 changed files with 25 additions and 5 deletions

View File

@ -32,6 +32,8 @@ LAUNCHD = /Library/LaunchDaemons
PLIST = org.$(NAME).server.plist PLIST = org.$(NAME).server.plist
NET_SRV = /boot/common/settings/network/services NET_SRV = /boot/common/settings/network/services
SYSTEMD = /lib/systemd/system SYSTEMD = /lib/systemd/system
SYSCONF = /etc/sysconfig
DEFAULT = /etc/default
DIST = $(PACKAGE)-$(VERSION) DIST = $(PACKAGE)-$(VERSION)
TGZ = $(DIST).tar.gz TGZ = $(DIST).tar.gz
@ -216,6 +218,12 @@ install-haiku:
install-systemd: install-systemd:
if [ -d "$(SYSTEMD)" -a ! -f "$(SYSTEMD)/$(NAME).socket" ]; then \ if [ -d "$(SYSTEMD)" -a ! -f "$(SYSTEMD)/$(NAME).socket" ]; then \
if [ -d "$(SYSCONF)" -a ! -f "$(SYSCONF)/$(NAME)" ]; then \
$(INSTALL) -m 644 $(NAME).env $(SYSCONF)/$(NAME); \
fi; \
if [ ! -d "$(SYSCONF)" -a -d "$(DEFAULT)" -a ! -f $(DEFAULT)/$(NAME) ]; then \
$(INSTALL) -m 644 $(NAME).env $(DEFAULT)/$(NAME); \
fi; \
$(INSTALL) -m 644 $(NAME).socket $(NAME)\@.service $(SYSTEMD); \ $(INSTALL) -m 644 $(NAME).socket $(NAME)\@.service $(SYSTEMD); \
systemctl daemon-reload; \ systemctl daemon-reload; \
systemctl enable $(NAME).socket; \ systemctl enable $(NAME).socket; \
@ -253,7 +261,7 @@ uninstall-systemd:
if [ -d "$(SYSTEMD)" -a -f "$(SYSTEMD)/$(NAME).socket" ]; then \ if [ -d "$(SYSTEMD)" -a -f "$(SYSTEMD)/$(NAME).socket" ]; then \
systemctl stop $(NAME).socket; \ systemctl stop $(NAME).socket; \
systemctl disable $(NAME).socket; \ systemctl disable $(NAME).socket; \
rm -f $(SYSTEMD)/$(NAME).socket $(SYSTEMD)/$(NAME)\@.service; \ rm -f $(SYSTEMD)/$(NAME).socket $(SYSTEMD)/$(NAME)\@.service $(SYSCONF)/$(NAME) $(DEFAULT)/$(NAME); \
fi fi
@echo @echo

View File

@ -18,15 +18,15 @@ directory and replace this page.
# Real-time configuration output (WOO!) # Real-time configuration output (WOO!)
# #
Generic information: Generic information:
=echo " current time...: `date`"
=echo " your ip address: $REMOTE_ADDR" =echo " your ip address: $REMOTE_ADDR"
=echo " server uptime..: `uptime | sed 's/.*up \([^,]*\), .*/\1/' `" =echo " server time....: `date`"
=echo " server uptime..: `uptime | sed 's/.*up *\([^,]*\), .*/\1/'`"
=echo " server version.: $SERVER_VERSION" =echo " server version.: $SERVER_VERSION"
=echo " server platform: $SERVER_ARCH" =echo " server platform: $SERVER_ARCH"
=echo " description....: $SERVER_DESCRIPTION" =echo " description....: $SERVER_DESCRIPTION"
Server configuration: Server configuration:
=echo " config file....: `for FILE in /Library/LaunchDaemons/org.gophernicus.server.plist /boot/common/settings/network/services /lib/systemd/system/gophernicus\@.service /etc/xinetd.d/gophernicus /etc/inetd.conf; do if [ -f $FILE ]; then echo $FILE; break; fi; done`" =echo " config file....: `for FILE in /etc/sysconfig/gophernicus /etc/default/gophernicus /Library/LaunchDaemons/org.gophernicus.server.plist /boot/common/settings/network/services /lib/systemd/system/gophernicus\@.service /etc/xinetd.d/gophernicus /etc/inetd.conf; do if [ -f $FILE ]; then echo $FILE; break; fi; done`"
=echo " server hostname: $SERVER_HOST" =echo " server hostname: $SERVER_HOST"
=echo " root directory.: $DOCUMENT_ROOT" =echo " root directory.: $DOCUMENT_ROOT"
=echo " running as user: `whoami`" =echo " running as user: `whoami`"

10
gophernicus.env Normal file
View File

@ -0,0 +1,10 @@
# Options for Gophernicus
#
# See README or run "in.gophernicus -?" to see a full list of
# configuration options.
#
# Example:
# OPTIONS="-h full.hostname -D \"I find your lack of gopher disturbing.\""
#
# Uncomment and add your options here:
#OPTIONS=""

View File

@ -2,6 +2,8 @@
Description=Gophernicus gopher server Description=Gophernicus gopher server
[Service] [Service]
ExecStart=/usr/sbin/in.gophernicus -h %H EnvironmentFile=-/etc/default/gophernicus
EnvironmentFile=-/etc/sysconfig/gophernicus
ExecStart=/usr/sbin/in.gophernicus -h %H $OPTIONS
StandardInput=socket StandardInput=socket
User=nobody User=nobody