Browse Source

Merge pull request #105 from CameronNemo/daemon

Various init script and daemonization fixups
pull/106/head
orignal 10 years ago
parent
commit
51b2b5676c
  1. 5
      Daemon.cpp
  2. 22
      debian/i2pd.init
  3. 10
      debian/i2pd.upstart

5
Daemon.cpp

@ -83,8 +83,6 @@ namespace i2p @@ -83,8 +83,6 @@ namespace i2p
{
// initialize log
if (isLogging)
{
if (isDaemon)
{
std::string logfile_path = IsService () ? "/var/log" : i2p::util::filesystem::GetDataDir().string();
#ifndef _WIN32
@ -94,9 +92,6 @@ namespace i2p @@ -94,9 +92,6 @@ namespace i2p
#endif
StartLog (logfile_path);
}
else
StartLog (""); // write to stdout
}
d.httpServer = new i2p::util::HTTPServer(i2p::util::config::GetArg("-httpport", 7070));
d.httpServer->Start();

22
debian/init.d → debian/i2pd.init vendored

@ -57,10 +57,10 @@ do_stop() @@ -57,10 +57,10 @@ do_stop()
}
# Function that sends a SIGHUP to the daemon/service
#do_reload() {
# start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
# return 0
#}
do_reload() {
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
@ -82,14 +82,12 @@ case "$1" in @@ -82,14 +82,12 @@ case "$1" in
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
# If the "reload" option is implemented then remove the
# 'force-reload' alias
reload|force-reload)
log_daemon_msg "Reloading $DESC" "$NAME"
do_reload
log_end_msg $?
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in

10
debian/i2pd.upstart vendored

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
description "i2p client daemon"
start on runlevel [2345]
stop on runlevel [016] or unmounting-filesystem
# these can be overridden in /etc/init/i2pd.override
env I2P_HOST="1.2.3.4"
env I2P_PORT="4567"
exec /usr/sbin/i2pd --daemon=0 --log=1 --host=$I2P_HOST --port=$I2P_PORT
Loading…
Cancel
Save