Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. 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 need the service to automatically start upon boot, it does not require console access for a start. Ofcause it would be nice to be able to produce some output for logging/debugging/stats. But for now, I just need a "TCP listener" that runs in the background, written in C#/mono.

Anyone in here able to show me how you install a service in Debian?

So this program isnt visible, its just like a "daemon" or cron perhaps. Cant figure out where to put it and how to initiate it.

share|improve this question
cron is a daemon ;) – goldilocks Feb 27 '13 at 17:35

Create an init.d script to run your application

you can run the mono service in linux OS by using the command mono-service [options] program.exe call this from an init.d sript

Check this man page for more details about running mono service on linux http://linux.die.net/man/1/mono-service

share|improve this answer
cool will try to check that out – BerggreenDK Feb 27 '13 at 23:15

If you don't want to write a debian style sysv init script (see /etc/init.d/README), you can just append a line to /etc/rc.local, eg:

/full/path/to/myprogram &

The full path is necessary as $PATH may not be properly set for rc.local when it is run at boot (but it will be for "myprogram").

The & just backgrounds the process, allowing rc.local to continue and exit. "myprogram" is now running owned by root. That may be desirable if you want to open a low number privileged (server) port at start-up; for security the process should subsequently switch (effective) user id (euid/uid).

If you don't need root privileges at all:

/bin/su [user] -c /full/path/to/myprogram &
share|improve this answer
aha! interesting too! going to check tomorrow too. – BerggreenDK Feb 27 '13 at 23:16

you can create init.d script and use start-stop-daemon together with nohup to start your app in the background. Here is an example with kestrel web server (which is eventually run with mono). Just change \"$DNXRUNTIME\" kestrel > \"$LOGFILE\" to your command line.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.