It will work, but I'd give him the primary group users as OMV allows write access to it's shares to this group by default.
Here is the beginning of a install script:
Code
SEAFILE_USER=seafile
SEAFILE_HOME=/opt/seafile
USE_FASTCGI="false"
FASTCGI_PORT=8000
useradd -m -d ${SEAFILE_HOME} -c "Seafile Service Account" -s /usr/sbin/nologin -r ${SEAFILE_USER}
su -s /bin/bash ${SEAFILE_USER}
cd
wget https://bintray.com/artifact/download/seafile-org/seafile/seafile-server_5.1.3_x86-64.tar.gz
tar zxf seafile-server_5.1.3_x86-64.tar.gz
# some more to come
exit
cat > /etc/init.d/seafile-server <<'EOF'
#!/bin/sh
### BEGIN INIT INFO
# Provides: seafile-server
# Required-Start: $local_fs $remote_fs $network mysql
# Required-Stop: $local_fs mysql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts Seafile Server
# Description: starts Seafile Server
### END INIT INFO
# Change the value of "user" to your linux user name
user=root
# Change the value of "script_path" to your path of seafile installation
# usually the home directory of $user
seafile_dir=/home/seafile
script_path=${seafile_dir}/seafile-server-latest
seafile_init_log=${seafile_dir}/logs/seafile.init.log
seahub_init_log=${seafile_dir}/logs/seahub.init.log
# Change the value of fastcgi to true if fastcgi is to be used
fastcgi=false
# Set the port of fastcgi, default is 8000. Change it if you need different.
fastcgi_port=8000
#
# Write a polite log message with date and time
#
echo -e "\n \n About to perform $1 for seafile at `date -Iseconds` \n " >> ${seafile_init_log}
echo -e "\n \n About to perform $1 for seahub at `date -Iseconds` \n " >> ${seahub_init_log}
case "$1" in
start)
sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
if [ $fastcgi = true ];
then
sudo -u ${user} ${script_path}/seahub.sh ${1}-fastcgi ${fastcgi_port} >> ${seahub_init_log}
else
sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
fi
;;
restart)
sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
if [ $fastcgi = true ];
then
sudo -u ${user} ${script_path}/seahub.sh ${1}-fastcgi ${fastcgi_port} >> ${seahub_init_log}
else
sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
fi
;;
stop)
sudo -u ${user} ${script_path}/seahub.sh ${1} >> ${seahub_init_log}
sudo -u ${user} ${script_path}/seafile.sh ${1} >> ${seafile_init_log}
;;
*)
echo "Usage: /etc/init.d/seafile-server {start|stop|restart}"
exit 1
;;
EOF
replace "user=root" "user=${USER/}" "fastcgi=true" "fastcgi=${USE_FASTCGI}" "seafile_dir=/home/seafile" "seafile_dir=${SEAFILE_HOME}" "fastcgi_port=8000" "fastcgi_port=${FASTCGI_PORT}" -- /etc/init.d/seafile-server
chmod +x /etc/init.d/seafile-server
update-rc.d seafile-server defaults
Alles anzeigen
If you give the seafile user an no login shell, you have to use the -s parameter of su to continue with the install as seafile (or call sudo all the time)