1832595 Members
2910 Online
110043 Solutions
New Discussion

Re: requirement for app

 
SOLVED
Go to solution
navin
Super Advisor

requirement for app

Hello, what is the requirement or standard ownership privillage/ permissions of the scipts that should start when a system boots up.
Thanks Much.
Learning ...
7 REPLIES 7
Florian Heigl (new acc)
Honored Contributor
Solution

Re: requirement for app

mode 555, owner bin:bin
yesterday I stood at the edge. Today I'm one step ahead.
James R. Ferguson
Acclaimed Contributor

Re: requirement for app

Hi Havin:

I assume that you are referring to those scripts in '/sbin/init.d/'. If so, then permissions of 555 (r-xr-xr-x) with an ownership of bin:bin would be "standard". Since the process that starts these scripts is a root process, though, this doesn't matter that much.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: requirement for app

There are two mechanisms that can be (easily) used. 1) Place an entry in /etc/inittab 2) (the preferred method) create a file in /sbin/init.d that is responsible for both starting and stopping your service. Typically the way this is done is to copy the file /sbin/init.d/template to /sbin/init.d/myscript. You then modify the start) and stop) sections of a big case statement to actually perform the actions. There are also start_msg) and stop_msg) sections that are using to echo to the console that myscript is actually running.

Your final tasks are to create symbolic links from the run-level directories to the actual script in /sbin/init.d. Generally, when a service is started at run-level N, it is stopped at run-level N - 1. For example, let's suppose that you need to start myscript at run-level 3 and stop it at run-level 2.

You would do something like this:
ln -s /sbin/init.d/myscript /sbin/rc3.d/S912myscript

ln -s /sbin/init.d/myscript /sbin/rc2.d/K088myscript.

Note that the 3-digit SNNN and Knnn values add to 1000. This convention tends to order the start and stop sequences correctly.

You can also manually start and stop your service by :
/sbin/init.d/myscript start (or stop)

Man rc for details.
If it ain't broke, I can fix that.
navin
Super Advisor

Re: requirement for app

Thanks so much for the reply. Will it be a problem(means..app won't start) if the permissions are set to 742 and ownership is root.Thanks
Learning ...
A. Clay Stephenson
Acclaimed Contributor

Re: requirement for app

I am having a difficult time understanding in what context mode 742 would ever make sense but it's your box. If the script is to be executed by root, then 700 or better still 500 would make more sense.

The "gotcha" to avoid is, suppose that your /sbin/init.d/script does an "su mickey -c myotherscript"; in that case, "myotherscript" would need to readable and executable by user mickey.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: requirement for app

Hi Navin:

A script owned by 'root' with permissions of 742 will not be a problem for the reason I mentioned: the process starting your script during starup/shutdown sequeneces (ultimately 'init') is a 'root' process.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: requirement for app

Shalom navin,

The application will start.

If its owned by root it presents a security risk and could conceivably be used to gain root priviledges on the system.

Oracle and many other application vendors recommend you have an application user that you set up to own the app.

Other possible problems are if the app uses shared memory it will be hard to identify and can not be accessed by other users if its a multi user app.

In general, it is a bad idea to have an application owned by root.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com