Auto Stat Seafile with Systemd - CentOS 7

953 views
Skip to first unread message

John Ullom

unread,
Jan 2, 2015, 4:22:25 PM1/2/15
to sea...@googlegroups.com
Howdy All,

  I have installed Seafile on CentOS 7. All works except for auto start.

  I can start Seafile Manually using this:

# su - seafile
$ cd seafile-server-latest/
$ ./seafile.sh start
$ ./seahub.sh start
Using Systemd directions from this page: http://manual.seafile.com/deploy/start_Seafile_at_system_bootup.html
Here are the two files I created.








[Unit]

Description=Seafile

# add mysql.service or postgresql.service depending on your database to the line below

After=network.target mysql.service

[Service]

Type=oneshot

ExecStart=$/home/seafile/seafile-server-latest/seafile.sh start

ExecStop=$/home/seafile/seafile-server-latest/seafile.sh stop

RemainAfterExit=yes

User=seafile

Group=seafile


[Install]

WantedBy=multi-user.target

And

[Unit]

Description=Seafile hub

After=network.target seafile.service

[Service]

# change start to start-fastcgi if you want to run fastcgi

ExecStart=$/home/seafile/seafile-server-latest/seahub.sh start

ExecStop=$/home/seafile/seafile-server-latest/seahub.sh stop

User=seafile

Group=seafile

Type=oneshot

RemainAfterExit=yes

[Install]

WantedBy=multi-user.target


__________________________________________________

What am I missing? Thanks!

JCU

John Ullom

unread,
Jan 2, 2015, 7:49:02 PM1/2/15
to sea...@googlegroups.com
Update on my question.

I have cleaned up my two start up files by removing the dollar symbol. Now can start Seafile with 

systemctl start seafile
systemctl start seahub

I have run the enable command on both but it still doesn't auto start?

Any ideas?

Shuai Lin

unread,
Jan 2, 2015, 9:58:23 PM1/2/15
to sea...@googlegroups.com
Is there any error messages when systemd failed to start a service?

Or you can redirect the output of the start command to a file to ? Something like:

ExecStart=/home/seafile/seafile-server-latest/seafile.sh start > /tmp/seafile.init.log



--
You received this message because you are subscribed to the Google Groups "seafile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seafile+u...@googlegroups.com.
To post to this group, send email to sea...@googlegroups.com.
Visit this group at http://groups.google.com/group/seafile.
For more options, visit https://groups.google.com/d/optout.

John Ullom

unread,
Jan 2, 2015, 11:00:47 PM1/2/15
to sea...@googlegroups.com
When I rund systemctl I can see that both seafile and seahub failed to start. 

I can start each service by running /etc/serviced/service/seafile.service and /etc/serviced/service/seahub.service .

I assume that those two files are working.

I tried your suggestion but nothing happens. No log file is created

I have chomd +x both files.

thanks for responding.



--
You received this message because you are subscribed to a topic in the Google Groups "seafile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/seafile/NknOL_lv14I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to seafile+u...@googlegroups.com.

John Ullom

unread,
Jan 3, 2015, 1:23:54 AM1/3/15
to sea...@googlegroups.com
OK, figure it out. Here are some change I suggest for your systemd/systemctl set up instructions.

1: chmod +x seafile.service and chmod +x seahub.service
2: systemctl enable seafile and systemctl enable seahub

And most important

3: You have a section in your tutorial where you say:

# add mysql.service or postgresql.service depending on your database to the.........

In Cent OS, I have Mysql but it is called mariadb. I do not know why. When I change the line to this:

After=network.target   mariadb.service


Success!!!!

Great product. Other than the autostart on boot, easy to set up and use.

Reply all
Reply to author
Forward
0 new messages