Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d0b5b3874e | ||
![]() |
59479597d5 | ||
![]() |
e85229dc90 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,6 +2,10 @@
|
|||||||
/cert.pem
|
/cert.pem
|
||||||
/key.pem
|
/key.pem
|
||||||
/_netdb
|
/_netdb
|
||||||
|
/i2pkeys
|
||||||
|
/onionkeys
|
||||||
|
/tlskeys
|
||||||
|
/tmp
|
||||||
i2pseeds.su3
|
i2pseeds.su3
|
||||||
*.pem
|
*.pem
|
||||||
onion.key
|
onion.key
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
#Edit the contact/signing email used by your reseed server here
|
# Edit the contact/signing email used by your reseed server here
|
||||||
|
# Required: Set a valid email address
|
||||||
export RESEED_EMAIL=""
|
export RESEED_EMAIL=""
|
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: reseed
|
# Provides: reseed
|
||||||
# Required-Start: $local_fs $network $named $time $syslog
|
# Required-Start: $local_fs $network $named $time $syslog
|
||||||
@@ -13,21 +13,58 @@ RUNAS=i2psvc
|
|||||||
NETDBDIR=/var/lib/i2p/i2p-config/netDb
|
NETDBDIR=/var/lib/i2p/i2p-config/netDb
|
||||||
RUNDIR=/var/lib/i2p/i2p-config/reseed
|
RUNDIR=/var/lib/i2p/i2p-config/reseed
|
||||||
MORE_OPTIONS=""
|
MORE_OPTIONS=""
|
||||||
|
PIDFILE="$RUNDIR/reseed.pid"
|
||||||
|
TIMEOUT=60
|
||||||
if [ -f /etc/default/reseed ]; then
|
if [ -f /etc/default/reseed ]; then
|
||||||
. /etc/default/reseed
|
. /etc/default/reseed
|
||||||
fi
|
fi
|
||||||
RUNOPTS=" reseed --yes=true --netdb=$NETDBDIR $MORE_OPTIONS "
|
RUNOPTS=" reseed --yes=true --netdb=$NETDBDIR $MORE_OPTIONS "
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
start-stop-daemon --background --user $RUNAS --chuid $RUNAS --exec $SCRIPT --chdir $RUNDIR --make-pidfile --pidfile $RUNDIR/reseed.pid --start -- $RUNOPTS
|
if [ ! -d "$RUNDIR" ]; then
|
||||||
|
mkdir -p "$RUNDIR"
|
||||||
|
chown $RUNAS:$RUNAS "$RUNDIR"
|
||||||
|
fi
|
||||||
|
if [ -z "$RESEED_EMAIL" ]; then
|
||||||
|
echo "Error: RESEED_EMAIL not configured" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
start-stop-daemon --background \
|
||||||
|
--user $RUNAS \
|
||||||
|
--chuid $RUNAS \
|
||||||
|
--exec $SCRIPT \
|
||||||
|
--chdir $RUNDIR \
|
||||||
|
--make-pidfile \
|
||||||
|
--pidfile $PIDFILE \
|
||||||
|
--start \
|
||||||
|
--startas $SCRIPT -- $RUNOPTS
|
||||||
|
|
||||||
|
for i in $(seq 1 $TIMEOUT); do
|
||||||
|
if status >/dev/null; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
start-stop-daemon --background --user $RUNAS --exec $SCRIPT --chdir $RUNDIR --remove-pidfile --pidfile $RUNDIR/reseed.pid --stop
|
start-stop-daemon \
|
||||||
|
--user $RUNAS \
|
||||||
|
--exec $SCRIPT \
|
||||||
|
--chdir $RUNDIR \
|
||||||
|
--remove-pidfile \
|
||||||
|
--pidfile $RUNDIR/reseed.pid \
|
||||||
|
--stop
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
start-stop-daemon --background --user $RUNAS --exec $SCRIPT --chdir $RUNDIR --pidfile $RUNDIR/reseed.pid --status
|
start-stop-daemon \
|
||||||
|
--user $RUNAS \
|
||||||
|
--exec $SCRIPT \
|
||||||
|
--chdir $RUNDIR \
|
||||||
|
--pidfile $RUNDIR/reseed.pid \
|
||||||
|
--status
|
||||||
}
|
}
|
||||||
|
|
||||||
restart() {
|
restart() {
|
||||||
@@ -42,7 +79,7 @@ uninstall() {
|
|||||||
if [ "$SURE" = "yes" ]; then
|
if [ "$SURE" = "yes" ]; then
|
||||||
stop
|
stop
|
||||||
rm -f "$PIDFILE"
|
rm -f "$PIDFILE"
|
||||||
echo "Notice: log file is not be removed: '$LOGFILE'" >&2
|
echo "Notice: log file is not removed" >&2
|
||||||
update-rc.d -f reseed remove
|
update-rc.d -f reseed remove
|
||||||
rm -fv "$0"
|
rm -fv "$0"
|
||||||
fi
|
fi
|
||||||
@@ -65,5 +102,5 @@ case "$1" in
|
|||||||
restart
|
restart
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {start|stop|restart|uninstall}"
|
echo "Usage: $0 {start|stop|restart|uninstall|status}"
|
||||||
esac
|
esac
|
||||||
|
@@ -11,6 +11,10 @@ ExecStart=/usr/bin/reseed-tools reseed --yes=true --netdb=/var/lib/i2p/i2p-confi
|
|||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
RuntimeMaxSec=43200
|
RuntimeMaxSec=43200
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
#MemoryMax=512M
|
||||||
|
#CPUQuota=50%
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@@ -2,4 +2,5 @@
|
|||||||
# without it the reseed will fail to start.
|
# without it the reseed will fail to start.
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
# Required: Set a valid email address
|
||||||
Environment="RESEED_EMAIL="
|
Environment="RESEED_EMAIL="
|
Reference in New Issue
Block a user