top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to start daemon processes after reboot on SLES 11/12?

+3 votes
464 views

I have a script which will start few daemon processes,
What i want is, After reboot this script should start with an argument.

Can anyone help?

posted Aug 1, 2016 by Chirag Gangdev

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
use /etc/init.d directory and put your daemon there. Just go to directory /etc/init.d and open any daemon and you will get a feel what to be done.
If you are just a normal user then you could use cron to run processes at boot time by specifying the start time as @reboot

@reboot myprogram -c config

Similar Questions
+1 vote

I am running below script on sles 11 and getting different output.

#!/bin/bash
PID=$(/bin/ps aux | grep sro-rest | grep -v grep | awk '{print $2}')
echo "PID = $PID"
. /etc/rc.status
PID=$(/bin/ps aux | grep sro-rest | grep -v grep | awk '{print $2}')
echo "PID = $PID"

Output:

PID = 2453
PID =

After debugging, I get to know that once we run . /etc/rc.status then output of ps aux is getting short.
See below script for example,

#!/bin/bash
echo "Before ==================================> "
/bin/ps aux | grep java | grep -v grep
. /etc/rc.status
echo "After ==================================> "
/bin/ps aux | grep java | grep -v grep

Output :

Before ==================================>
root      2453  4.9  7.8 8496196 615020 ?      Sl   Jun05  60:31 /usr/java/jre1.8.0_77//bin/java -Djava.net.preferIPv4Stack=true -Djava.library.path=/opt/sro/lib -Dserver.port=50000 -Dspring.profiles.active=gal -jar /opt/sro/ui/lib/sro-rest-SNAPSHOT.jar
After ==================================>
root      2453  4.9  7.8 8496196 615020 ?      Sl   Jun05  60:31 /usr/java/jre1.8.0_77//bin/java -Djava.net.preferIPv4Stack=true -Djava.l

Can anyone explain why different behavior for the same command?

+1 vote

I have an application and whenever i start it i want it to be started as daemon process.
How will i achieve that?

Below is the sample code:

#include<stdio.h>
main()
{
    while(1)
    {
             printf(" Do Some Task Here\n");
     }
}
+2 votes

On openSUSE I see python-matplotlib updated very often. Sometimes more as once a week. It is also not very small (almost 40 MB).
Is there a reason for this, or is there a problem at SUSE?

0 votes

I have a server with an 17tb scsi-storage. In past, the storage has a "jfs"-filesystem. Now i want to create a "ext4"-filesystem. I have update the e2fsprogs from 1.41 to 1.42 (16tb limit >1.41).

Now I have an 17tb-storage as /dev/sda1 with ext4. I can mount this device as /home/ (/etc/fstab /dev/sda1 /home/ ext4 defaults 1 2". Now I start a e2fschk /dev/sda1 (umounted). No error-messages are in
the screen.

If I now reboot the server, the server does not started:

I think thats can be a problem with the e2fsprogs 1.42, now i reinstall the server with the default e2fsprogs 1.41 from CentOS 6.4 and create only a 16tb /dev/sda1 partition with ext4. But if i start a "e2fschk
/dev/sda1" and reboot the server, i have the same message in the boot-screen and the server does not boot.

Why the system thinks that the device still be in use? How can i change this?

...