Init.d Script
Hello all,
I'm running Debian Lenny x86 and i just installed glassfish with some errors ( if you can give me hand i will greatly appreciate it click here) but the problem i have now is about the user who is launching the server and that user is root. How i can make the user glassfish that i previously created to start the server executing the /etc/init.d/glassfish script i'm using, like the user proxy start the squid3, the user mysql start mysql database, the user www-data start apache2 and the user tomcat start the tomcat servlet server, etc I checked the squid3, apache2 and mysql scripts but couldn't figure out how they make those users to start the services, all /etc/init.d belongs to root and the /etc/squid3, /etc/apache2 , etc too. (nothing about su -c or any user change ) The point is, how i can make a boot script that the owner is root and make other user start the service taking by example the /etc/init.d/skeleton file INTI.D SCRIPT Code:
#! /bin/sh Code:
intranet:/opt# l |
Quote:
|
Sorry Dutch Master, my english sometime is confusing (not my native languge). What i want to do is to start, stop or restart a service by a user. For example, to start apache2 you type as root
Code:
/etc/init.d/apache2 start Code:
intranet:~# ps -fu www-data Code:
/etc/init.d/squid3 start Code:
intranet:~# ps -fu proxy Code:
intranet:~# ps -fu root |
English isn't my native language either ;) Anyway, I understand what you want, but I still fail to understand why. What's wrong with root instead of glassfish, a user you've created yourself? Mind you, in Linux the saying goes: If you can't fix it yourself, don't break it! ;)
|
Jajajajaja, well, i want to try it with another user for 2 things.
1.- To obtain more knowledge of Linux. I know that i can create a .sh script and log as glassfish user and start the service. I can even put it any rc.*.d folder for boot, but what happens for example, if i want to make a package with glassfish for Debian. Like tomcat, tomcat service is running by tomcat user, not root. Code:
repositorio:~# ps -fu tomcat6 Sadly i'm not a sys admin, i asked to be transfered to unix support where i work but nothing. So this is only for fun and point 1. And perhaps could make the package for repos, that could be great. Cheers and again thanks for your time |
In that case, try to figure out how tomcat did it, and you're there ;)
|
Ok, tomcat was a bad example, is passing the user in this line /usr/bin/jsvc -user tomcat6... but the apache and squid script, is not passing any user, i try to find in the script any sign of www-data for the apache or user proxy for the squid, and nothing.
Or its setup in the binary file? Well, thanks for your time either way, i will try to solve this thing out |
From the apache man page:
Quote:
Code:
$ ps aux |grep apache Quote:
|
I have used super to achieve this:
Quote:
Code:
:define SuperUsers username super daemonstart Regards, Stefan |
Thank you propofol. Worked very well, didn't know about this program. Really appreciate the help.
|
man start-stop-daemon
Quote:
Quote:
also Debian - Daemons and init scripts Creating a Daemon in Debian Linux |
thanks farslayer, going to check out those links.
|
All times are GMT -5. The time now is 08:06 AM. |