mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
parent
6697b8fde3
commit
f2e9b40ad1
@ -38,13 +38,14 @@ syncthing_group=${syncthing_group:-$syncthing_user}
|
|||||||
|
|
||||||
command=/usr/local/bin/syncthing
|
command=/usr/local/bin/syncthing
|
||||||
pidfile=/var/run/syncthing.pid
|
pidfile=/var/run/syncthing.pid
|
||||||
syncthing_flags="${syncthing_home:+-home=${syncthing_home}} ${syncthing_log_file:+-logfile=${syncthing_log_file}}"
|
syncthing_cmd=serve
|
||||||
|
syncthing_flags="${syncthing_home:+--home=${syncthing_home}} ${syncthing_log_file:+--logfile=${syncthing_log_file}}"
|
||||||
|
|
||||||
syncthing_start() {
|
syncthing_start() {
|
||||||
echo "Starting syncthing"
|
echo "Starting syncthing"
|
||||||
touch ${pidfile} && chown ${syncthing_user} ${pidfile}
|
touch ${pidfile} && chown ${syncthing_user} ${pidfile}
|
||||||
touch ${syncthing_log_file} && chown ${syncthing_user} ${syncthing_log_file}
|
touch ${syncthing_log_file} && chown ${syncthing_user} ${syncthing_log_file}
|
||||||
/usr/sbin/daemon -cf -p ${pidfile} -u ${syncthing_user} ${command} ${syncthing_flags}
|
/usr/sbin/daemon -cf -p ${pidfile} -u ${syncthing_user} ${command} ${syncthing_cmd} ${syncthing_flags}
|
||||||
}
|
}
|
||||||
|
|
||||||
syncthing_cleanup() {
|
syncthing_cleanup() {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Name=Start Syncthing
|
Name=Start Syncthing
|
||||||
GenericName=File synchronization
|
GenericName=File synchronization
|
||||||
Comment=Starts the main syncthing process in the background.
|
Comment=Starts the main syncthing process in the background.
|
||||||
Exec=/usr/bin/syncthing -no-browser -logfile=default
|
Exec=/usr/bin/syncthing serve --no-browser --logfile=default
|
||||||
Icon=syncthing
|
Icon=syncthing
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
|
@ -5,5 +5,4 @@ export HOME="/home/$USERNAME"
|
|||||||
export SYNCTHING="$HOME/bin/syncthing"
|
export SYNCTHING="$HOME/bin/syncthing"
|
||||||
|
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
exec chpst -u "$USERNAME" "$SYNCTHING" -logflags 0
|
exec chpst -u "$USERNAME" "$SYNCTHING" serve --logflags 0
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=%i
|
User=%i
|
||||||
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0
|
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
SuccessExitStatus=3 4
|
SuccessExitStatus=3 4
|
||||||
|
@ -3,7 +3,7 @@ Description=Syncthing - Open Source Continuous File Synchronization
|
|||||||
Documentation=man:syncthing(1)
|
Documentation=man:syncthing(1)
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0
|
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
SuccessExitStatus=3 4
|
SuccessExitStatus=3 4
|
||||||
|
Loading…
Reference in New Issue
Block a user