Re: how to make my deamon depends on other
- From: john_woo@xxxxxxxxxx
- Date: 29 Jul 2006 14:53:57 -0700
Bo Yang wrote:
john_woo@xxxxxxxxxx wrote:
struggle wrote:
The further question is, all these mysql and mydeamon,other deamons
have be in a auto-installation-script. The difficalty for me is,
mysql-deamon is from mysql.org, which provides only a file.rpm, and
after installing, the mysql-deamon generated, thus I have no idea what
#id
for it in advance.
Oh , I think if you look the directory , you will find something like
mysqlDD where DD is two number . No matter how your daemon is installed
, the daemon-start file must have a self-explained name for maintance .
Yes, you r right.
let's say I got the pid of mysqld is 2400. How can I make
cat mydemond.pid = 2401?
Does this make any sense in your app that the mydaemon's pid one more
than the mysql pid ? I have no idea about how to control the system
process's pid , I think indeed it can't be controlled . If you must
need to do so , I think you should take consideration to redisign your
app .
You mean , although your daemon-start script chown the first batch of
chown didn't work in this case, b/c the app creates more than 1 logPlease put what you want to do clearly here , why do the files' owner
file, and those are re-writable, namely whenever re-writes, the owner
of the log file changed back to root who is the system-starting the
deamon.
change back to root ? I can't understand !
As mydemond and mysqld a executed by root, all ouput files from these
app a owned by
root.
I used <chown> in mydeamon script to change the owner of log file.
It's okay if the log file is not overwritten.
That's, my app will aoto rewrite log files:
if size of log1 > SIZE, it writes to log2; if .. then write to log3...
if log9... then the app
will remove all logs, and start to write to log1;
so at the second writing cycle, all logs owned by root.
log files , but your daemon , which run as root , will produce new ones
which ownship is still root .
If you want rotate logs , you can just use syslog or other log system ,
you needn't ot reinvnt the wheels .
If you must to do so , I think the only way is the change your log file
produce code in Java , to make it to process the ownship trouble .
Wish can help you !
--
John
Java code can't control the ownership of output file. I don't how to
use "syslog" in
java code either.
I guess only OS. admin stuff can do that. like chown, use other use
rather than root to exeecute daemon, but it seems it needs root to run
service daemon script.
--
John
Toronto
.
- References:
- how to make my deamon depends on other
- From: john_woo
- Re: how to make my deamon depends on other
- From: struggle
- Re: how to make my deamon depends on other
- From: john_woo
- Re: how to make my deamon depends on other
- From: struggle
- Re: how to make my deamon depends on other
- From: john_woo
- Re: how to make my deamon depends on other
- From: Bo Yang
- how to make my deamon depends on other
- Prev by Date: Re: script that remove itself
- Next by Date: Re: start and stop a process
- Previous by thread: Re: how to make my deamon depends on other
- Next by thread: Linux and pdksh: losing history...
- Index(es):
Relevant Pages
|