Hallo zusammen,
ich komm irgendwie nicht weiter… ich versuche nun schon eine weile, den Cli Client beim Systemstart starten zu lassen. Jedoch immer ohne Erfolg. Ich habe die Schritte “For systems running systemd” aus dieser Anleitung ausprobiert:
######################################
Start Seafile at System Bootup
For systems running systemd
- For example Debian 8 and newer, Linux Ubuntu 15.04 and newer
Create systemd service files, change ${seafile_dir} to your seafile installation location and seafile to user, who runs seafile (if appropriate). Then you need to reload systemd’s daemons: systemctl daemon-reload .
Create systemd service file /etc/systemd/system/seafile.service
sudo vim /etc/systemd/system/seafile.service
The content of the file is:
[Unit]Description=Seafile# add mysql.service or postgresql.service depending on your database to the line belowAfter=network.target[Service]Type=forkingExecStart=${seafile_dir}/seafile-server-latest/seafile.sh startExecStop=${seafile_dir}/seafile-server-latest/seafile.sh stopLimitNOFILE=infinityUser=seafileGroup=seafile[Install]WantedBy=multi-user.target
Create systemd service file /etc/systemd/system/seahub.service
sudo vim /etc/systemd/system/seahub.service
The content of the file is (please dont forget to change it if you want to run fastcgi):
[Unit]Description=Seafile hubAfter=network.target seafile.service[Service]Type=forking# change start to start-fastcgi if you want to run fastcgiExecStart=${seafile_dir}/seafile-server-latest/seahub.sh startExecStop=${seafile_dir}/seafile-server-latest/seahub.sh stopUser=seafileGroup=seafile[Install]WantedBy=multi-user.target
Create systemd service file /etc/systemd/system/seafile-client.service (optional)
You need to create this service file only if you have seafile console client and you want to run it on system boot.
sudo vim /etc/systemd/system/seafile-client.service
The content of the file is:
[Unit]Description=Seafile client# Uncomment the next line you are running seafile client on the same computer as server# After=seafile.service# Or the next one in other case# After=network.target[Service]Type=oneshotExecStart=/usr/bin/seaf-cli startExecStop=/usr/bin/seaf-cli stopRemainAfterExit=yesUser=seafileGroup=seafile[Install]WantedBy=multi-user.target
Enable service start on system boot
sudo systemctl enable seafile.servicesudo systemctl enable seahub.servicesudo systemctl enable seafile-client.service # optional
######################################
Und auch noch diese Anleitung:
Dabei muss der Inhalt hier angelegt werden:
sudo nano /etc/init.d/seaf-cli
#! /bin/sh
BEGIN INIT INFO
Provides: seaf-cli
Required-Start: $remote_fs $syslog
Required-Stop: $remote_fs $syslog
Default-Start: 2 3 4 5
Default-Stop: 0 1 6
Short-Description: Simple start script for seafile cli
Description: Should be placed in /etc/init.d.
END INIT INFO
Author: Sven Knuth sven.knuth@yawc.de
Do NOT “set -e”
PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC=“Seafile Commandline”
NAME=seaf-cli
DAEMON=/usr/sbin/$NAME
USER=xbmc
Define LSB log_* functions.
Depend on lsb-base (>= 3.2-14) to ensure that this file is present
and status_of_proc is working.
. /lib/lsb/init-functions
do_start()
{
su -c “$DAEMON start” - $USER
}
do_stop()
{
su -c "$DAEMON stop" - $USER
}
case “$1” in
start)
[ “$VERBOSE” != no ] && log_daemon_msg “Starting $DESC” “$NAME”
su -c “$DAEMON status” - $USER > /dev/null 2>&1
case “$?” in
0) echo “$DAEMON already started” ;;
1) do_start
esac
;;
stop)
[ “$VERBOSE” != no ] && log_daemon_msg “Stopping $DESC” “$NAME”
su -c “$DAEMON status” - $USER > /dev/null 2>&1
case “$?” in
1) echo “$DAEMON already stopped” ;;
0) do_stop ;;
esac
;;
status)
su -c “$DAEMON status” - $USER > /dev/null 2>&1
case “$?” in
1) echo “$DAEMON not started” ;;
0) su -c “$DAEMON status” - $USER
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status}" >&2
exit 3
;;
esac
:
Dies muss nun nur noch ausfuehrbar gemacht werden.
sudo chmod +x /etc/init.d/seaf-cli
Ausserdem muss es einen Verweiss auf den Seafile-Client unter /usr/sbin/seaf-cli geben.
Damit es bei jedem Neustart ausgefuehrt wird und beim Shutdown ordentlich beendet, noch folgenden Befehl ausfuehren:
sudo update-rc.d seaf-cli defaults
######################################
Hab bei der 2. Anleitung einen User erstellt und diesem die Rechte an den dem Script gegeben, jedoch auch alles ohne Erfolg…
Hat von euch jemand eine Idee, was ich hier eventuell vergessen habe oder falsch mache?
Ah und das System, auf dem ich es installiert habe, ist ein Ubuntu 18.04.