Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.