Upstart initctl

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Upstart initctl
# 1  
Old 10-03-2016
Upstart initctl

The upstart package that provides initctl command also provides following other commands:
start, stop, status etc
These commands are all present in /sbin/ in Redhat systems. We can see that status, start, stop, restart are all symlinks to initctl. How do they still work differently? For example to check the status of a job, we can do:

Code:
>>> initctl status <job>

We can also do
Code:
>>> status <job>

How is that status command works differently when it is a symlink to initctl?

Thanks
RC
Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by rbatte1; 10-04-2016 at 05:46 AM.. Reason: Add CODE and ICODE tags.
# 2  
Old 10-03-2016
Quote:
Originally Posted by Rameshck
The upstart package that provides initctl command also provides following other commands:
start
stop
status etc
These commands are all present in /sbin/ in Redhat systems. We can see that status, start, stop, restart are all symlinks to initctl. How do they still work differently? For example to check the status of a job, we can do:

Code:
>>> initctl status <job>

We can also do
Code:
>>> status <job>

How is that status command works differently when it is a symlink to initctl?

Thanks
RC
Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!
When you exec a program, the name of the file executed (and it doesn't matter if this is a symbolic link or a hard link) typically appears as the "zeroth" argument to the program when it starts running. If the program is a shell script for a shell that is based on Bourne shell syntax, that value can be referenced in the script by the expansion of positional parameter 0 (i.e., $0). If you are in a C program where the entry to main is conventionally through the function main with a function prototype similar to:
Code:
int main(int argc, char *argv[]);

you could access it in main() by looking at argv[0].

In either case, if the zeroth argument's last pathname component is initctl, the action to be performed is determined by the 1st argument; otherwise, the last pathname component of the zeroth argument is the action to be performed.
This User Gave Thanks to Don Cragun For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

timeout opening writing control channel /dev/initctl problem occur i cant shoudown

Hi... This is message that occurs when i am trying to shutdown the linux system timeout opening writing control channel /dev/initctl how can i shutdown what is the problem here.. Thanks in advance ... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies
Login or Register to Ask a Question