?
Solved

Start process with specific id at bootime -Solaris 2.6

Posted on 2000-05-06
3
Medium Priority
?
298 Views
Last Modified: 2013-12-27
On solaris 2.6 (sparc)I have Apache firing up from the /etc/rc3.d directory.

I need to start a process for some webtools at bootime as well, with a specific userid?
eg sysadmin

The syntax to start manually is....
/usr/local/apache/virtualhosts/webtools/bin/apachetcl start
This script is owned by root

How can this be done...thanks in advance
0
Comment
Question by:hyphen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
festive earned 600 total points
ID: 2783894
sounds like what you need is a SETUID
script, if I follow what you are saying correctly, then this is what you need..

Key things to remember : when you name the script /etc/rc3.d/S90webutils (etc)
you must start it AFTER apache, so pick a higher number than apaches (ie the 90 should be high enough)
Benefits of using the "su" method are that the process will inherit the login environment of the sysadmin user - this could be usefull if you have environment variables which others are changing and you don't want to keep updating the script.

Hope this helps

#!/bin/sh -p
# setuid shell script to start Apache and Web Tools
# install into /etc/rc3.d
# make owner "sysadmin"
# make group "bin"
# run chmod 4750 on the file (setuid)
# This will start the programs as "sysadmin"
echo "`date`: web started" >> /usr/local/logs/webstart.log
# now start apache as "sysadmin"
/usr/local/apache/virtualhosts/webtools/bin/apachetcl start
# optionally you could run the script as root
# and start with an su command like:
# su - sysadmin -c "/usr/local/apache/virtualhosts/webtools/bin/apachetcl start"


0
 
LVL 2

Expert Comment

by:festive
ID: 2783895
the "su" method requires no setuid but does mean that root could be running things that could be altered by others (in this case the .profile of sysadmin)
0
 

Author Comment

by:hyphen
ID: 2803340
Thanks Festive,
Tried su - c "/usr/local/....blah, blah" in a symlink...it bombed out with an apache exit code 3

SETUID script is an effective way to run as "a specific user".

However, have found out there is a "virtualhosts/webtools/conf/http.conf" file with in Apache that you can use to set the user/group that this runs under. Then place appropriate symlink in the rc3.d directory (it kicks off as root and changes to "specified user/group"
regards hyphen
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question