[Solved] Process dies when launched in system startup script
Good morning!
I'm trying to add Maven to the system boot by the moment without success.
Testing the operation of the script I realize that the process isn't persistent when the program is launched with the start option.
---- #Startup Script ----
And this is how the application is natively launched out of the system startup (the script which i'm pointing):
Can anybody help to find out what's happening? When I check for the process, I find that the pid has changed in the pid.file but the process isn't running
Thank you so much.
Moderator's Comments:
Use code tags please, see PM.
Last edited by zaxxon; 07-19-2013 at 06:01 AM..
Reason: code tags
Processes do not disappear just like that, so there has to be some abnormal program termination.
Try to start the process by hand, imitating the steps the script takes and look where it gets you. maybe there are some error messages the script would redirect to /dev/null which you will see this way. You can also check error codes and see if they are described in the programs documentation. Maybe the software produces a core dump, then you can analyse that or send it to the software's manufacturer.
Thanks for reading and replying
I've tried to manually reproduce the steps but there's no error shown (even without the output redirection)
Anyone have any advice for making the startup script work? It makes sense to launch the program with the & and the exec to make the process persistent?
Regards.
I've tried to manually reproduce the steps but there's no error shown (even without the output redirection)
OK, what about the error code?
Is it zero? Any other value?
Quote:
Originally Posted by carpannav
It makes sense to launch the program with the & and the exec to make the process persistent?.
No. The difference between starting the process with and without the "&" is that it will be sent into background. Sending it into background will free the terminal you use for further commands, but not more.
"exec" will replace the script process with the started process. This makes sense for a startup script, which should neither end nor hang around left over after starting the process. In a debugging environment it will help you not at all because it will replace the shell process from which it where started with your programs process, effectively ending the terminal once it stops.
Looks like you will have to call tech support, which i suggest you do. A non-functional program which just exits instead of doing work is bad enough, but leaving no error message, exit code or anything hints at very sloppy (irresponsible) softare development. You might want to drop this software and use another one instead.
Thanks for the follow-up. You might want to consider making the startup script which sets the necessary environment executable for the user (instead for anybody else) and call this via su - user -c /path/to/script instead of setting the environment here (as the one user) and calling the executable there (as the other user). Personally i think it is a cleaner way to put the environment and the call of the executable together, but that might be personal preference.
Still, i stand by what i said before: if a program can't go on for some reason, that is OK, but it should tell the user so, either via a logfile entry, error message, return code or whatever. Anything else is not acceptable and programmers neglecting this rule should be made administrators of their own software for some time just to understand what they are doing. Make them analyse each and every coredump for each and every program shutdown they neglect to adorn with some diagnostic message or program action.
The below text is displayed on the console ->
sbin/rc2.d/S130pfilboot: -l: not found.
/sbin/rc2.d/S131ipfboot: -l: not found.
/sbin/rc2.d/S590Rpcd: -l: not found.
/sbin/rc2.d/S700acct: -l: not found.
/sbin/rc2.d/S900drd: -l: not found.
/sbin/rc3.d/S823hpws22_apache: -l: not found.... (4 Replies)
hi all
I have a problem how to write a shell script which delete files/folder form directory whenever system boot and copy last updated folder/file in the specified directory.pse help me ASAP.
i write a script which copy files in directory.I want when system boot up using script it check whether... (1 Reply)
Hello Scripts Guru
I had created a shell script to monitor the threshold of the file system, but some where it is not giving the correct output. Request to all to hel me out
I am getting the following output
/dev/vg00/lvol3 mounted on 1865224 10% / is 2097152%
/dev/vg00/lvol1 mounted on... (2 Replies)
get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same.
hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Hi.
I was testing some staff and wrote simple script, which only writes date to log every 15 seconds.
Like that
#1.sh
while true;do
echo `date` >> 1.log
sleep 15
done
And than i ran this process with `at -s -f 1.sh now`. And now it is running and i don't know how to catch it.
I tryed... (1 Reply)
I would like to setup a Cron job to check weather X process is running or not. if it is not running then start that X process with a log message....
can any one help writing a script?
thanks (3 Replies)
Hello there,
I "discovered" an interesting command lastlog, but I couldn't find, until now:cool:, if it's possible to get a list of the launched process by users and root during a certain of time...
...any idea would be really appreciated!!!
Thanks in advance.
Giordano Bruno (3 Replies)
Hi all,
There is an application which can be launched once on our box and there are several suspected users telnet into the system with the same login ID.
Is there a way that i can find out from which tty the application is launched? If so, i can get the user name from the "finger"... (1 Reply)
Hi all! I'm running Solaris 10 and have a question about how i can stop a certain program to start at system startup,for example, as it is now sendmail is starting but i don't need sendmail,on the other hand so would i be very glad to get cups up and running at startup, anyone who can explain where... (3 Replies)
Lets say a user starts a process (either a shell script or a Perl script) and before that process finishes, he logs out (either intentionaly or network problems or ...), does the process continu running ?
Default shell is Korn.
This is because at my job (being trained), there are tasks to run... (2 Replies)