Background service!

Hi I'm wondering,
Is there a way to run an application as a background service on HP-UNIX? I'm a complete noobie! Basically I got an application that runs as an NT service on windows. This application is cross-platform and I am wondering if I could run it as some background service on HP-unix such that even if the user is logged off it still executes in the background?

Please help with information surrounding this.

Regards

James

If u want the program to run in background....simply give the command like :

./servname &
---------

or else you may be looking for a daemon server. Daemon is a process that is completely detached of the input terminal. There are certain programming steps to make a program to run as a daemon that are taken care while developing that code.

Services on Unix are usually called daemons
because they silently and diligently run in the background for long periods
(mostly until next system reboot) and service clients (however the roles may
also be changed) thus acting like benign leprechauns contrary to malign demons
(note the different spelling).
To achieve this daemons in the traditional way fork after they have started.
This means they make an exact copy of their process also inheriting the environment
as well as file descriptors etc.
If you issue man fork you will notice that this is also the name of a Unix system library call.
Btw, you may already have come across Beastie the BSD mascot.
As can be easily realized Beastie is the incorporation of a Unix daemon with a fork in its hand.
Once a daemon has forked it would exit its parent process,
change directory to / (or into chroot), not to block other mounts,
close unused file descriptors, and do other prepatory cleanup or initialization work.
Finally to really background it would need to dissociate from any controlling terminal
by starting a new session through the setsid syscall.
In BSD style syntax you could issue ps x to get a list of all background processes.
If you started a process from an interactive shell with an appended ampersand &,
although it would background, you would still reap it if you exited your shell because on exit the shell (or the system) would send a hangup signal to all its backgrounded processes.
To avoid this you would also have to prepend a nohup before your startup command.
If you were using a Bash shell however you could still use the disown command for a merely backgrounded but not nohupped process (see man bash).