Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'would like to run a simple command upon startup on Archlinux (systemd):

nohup fatrat -n &

I've got this working on Debian:

#! /bin/sh
# /etc/init.d/fatratWS

# Provides: fatratWS
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fatratWS init script.
# Description: Starts and stops fatrat Web Server services.

FATRAT_PID=$(ps aux | awk '/fatrat --nogui/ && !/awk/ && !/nohup/ {print $2}')

# Carry out specific functions when asked to by the system
case "$1" in
echo "Starting script fatratWS"
if [ -z "$FATRAT_PID" ]; then
nohup fatrat --nogui &
echo "Started"
echo "fatratWS already started"
echo "Stopping script fatratWS"
if [ ! -z "$FATRAT_PID" ]; then
echo "OK"
if [ ! -z "$FATRAT_PID" ]; then
echo "The fatratWS is running with PID = "$FATRAT_PID
echo "No process found for fatratWS"
echo "Usage: /etc/init.d/fatratWS {start|stop|status}"
exit 1

exit 0

How can I achieve the same on Arch?

I've tried:

Description=Fatrat NoGui Web Access Service

ExecStart=/usr/bin/nohup /usr/bin/fatrat -n &


But it fails to start when starting manually (timeout)

share|improve this question
up vote 7 down vote accepted

Try this:

Description=Fatrat NoGui Web Access Service

ExecStart=/usr/bin/fatrat -n

  • I assumed, that a "Web Access Service" needs network, so I added as a requirement.

  • Using nohup is unnecessary because this functionality is provided by systemd itself, same for the '&'.

  • Because we don't use nohup anymore, the type would change to simple, however, the web interface available on the git release won't work unless we make it forking.

  • For more information on systemd service files see the "systemd.service" man page and

  • You might consider to add Restart=always to the [Service] section to get it restarted automatically if it crashes.

  • Put the service file at /etc/systemd/system/fatrat.service and enable it for automatic startup via systemctl enable fatrat.service

share|improve this answer
Thanks you, it works! The only difference I had to make was to add User=my_user_name under [Service] section to run the application as my user. This way the application can load its configuration files from /home/my_user_name/.local/share/fatrat/data – Joudicek Jouda Oct 24 '13 at 18:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .