On Fri, 9 May 2008 15:35:18 -0400 "Scorpion7" scorpion7@iqonline.net wrote:
Here's what happens:
nav start getDeviceData <enter>
(execution hangs - intr won't work, have to CTRL+Z and then do a kill -9 PID to stop. The same occurs for nav start eventengine)
Attached are 4 text files (extension to show which command was utilized to generate the output. The first line of each file shows the command and arguments utilized to generate the output. In getDeviceData it appears that the last action was to chdir to the nav directory.
Well, upon reading the truss output of "nav start getDeviceData", it seems that the "su" command is the one that hangs after the chdir command.
Can you successfully execute "su - navcron" as root? Does the navcron user have a valid login shell?
What is the difference between 'nav start ....' and executing the process directly, ie: cd etc/init.d ./getDeviceData start
"nav start ..." fails and "./getDeviceData start" succeeds? I think the inherent difference may help us to understand what is happening and why the failure. Or at least may help me to locate more pertinent data.
There's no difference, really. The nav command is a convenience tool to do all the starting and stopping in one go (plus the added crontab manipulation). It still calls the etc/init.d scripts in the end.
Are you running both commands as root?
Besides, you say that "nav start alertengine" seems to stall, and this command will not modify the crontab, since alertengine isn't a cronjob but a daemon. It will however look at the files in the cron.d directory, and look at the navcron user's crontab with "crontab -u navcron -l".
This is an interesting point. I su'd to navcron, just to verify and this command is denied (as I expected).
Wait, are you saying that "su - navcron" fails? That would be a reasonable cause for your problem. Several of the init scripts are designed to be run as root, and use su to drop privileges to navcron before executing processes that cannot drop privileges by themselves (such as java).
As I mentioned in less detail above, the navcron user must have a valid login shell for the su'ing to work.
there is a Python class for crontab but nothing that defines command line arguments (not familiar with python).
Crontab commands are hardcoded on lines 243 and 261 in startstop.py. The nav script requires root access to run properly (and will give a warning/error if executed by anyone but root).
I've also included the strace output - as it sounded like you are more familiar with strace - may help to locate the issue.
Thanks, although I found the complete truss (with forks) output more helpful this time around :-)