[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: permision problem?
From: |
gabev |
Subject: |
Re: permision problem? |
Date: |
Mon, 15 Jan 2007 09:43:10 -0800 (PST) |
Jan-Henrik Haukeland wrote:
>
> On 13. jan. 2007, at 05.33, gabev wrote:
>
>> I replaced the lines but still is no go.
>>
>> I believe is a permission problem ; in that chain , monit ,which
>> calls the
>> wrapper (sylph as I name it) , which in turn calls the program
>> sylpheed-claws , the permissions gets screwed somehow;
>> i guess i have to look deeper.
>
> Look, I have modified your script a bit and added debug trace using
> 'set -vx'. If you run the script from the console you should be able
> to see if and where it fails. If you see the text "Error: Should not
> come here!" then you need to investigate the program 'sylpheed-claws'
> since it puts itself in the background which will mess up the pid-
> file monit checks.
>
> Alternatively you can grab the pid of sylpheed-claws by replacing the
> start) block below with the following, assuming 'sylpheed-claws' is
> the name of the process
>
> $CM &;
> sleep 2;
> ps -aef|grep sylpheed-claws| \
> awk 'BEGIN{x=1000000;}{if($2<x)x=$2;}END{print x > "/tmp/
> sylpheed.pid";}';;
>
> ------------------8<-----------
> #!/bin/bash
> set -vx # print debug info
> export DISPLAY=localhost:0.0
> LOG_FILE=/tmp/CM_`date +%d%b%Y%H%M`.log
> CM=`which sylpheed-claws`
>
> if [ $? -ne 0 ]; then
> echo "Unable to find sylpheed-claws"
> exit 1
> fi
>
> case $1 in
> start)
> echo $$ > /tmp/sylpheed.pid ; # /var/run/sylpheed.pid is better
> exec 2>&1 1>$LOG_FILE $CM ;
> echo "Error: Should not come here!" ;;
> stop)
> kill `cat /tmp/sylpheed.pid` ;;
> *)
> echo "usage: sylpheed {start|stop}" ;;
> esac
> ------------------8<-----------
>
>
> Best regards
> --
> Jan-Henrik Haukeland
> http://tildeslash.com/
>
>
>
>
>
>
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general
>
>
I run the script (sylph start ) from the console , as root, and no
errors.the email client started just fine.But when I tried to start with
monit , (monit start sylpheed-claws ) I cached the folllowing error :
GTK-Warning**:cannot open display : 'sylpheed-claws' failed to start . So it
seems that the problems relies when monit calls the email client through the
wrapper script ; I looked at the executable permissions and they all are the
same (run as root, in this case); also in monitrc I put the condition to run
the wrapper as uid root and gid root :
```````````````````````````````````````````````````
check process sylpheed-claws with pidfile /tmp/sylpheed.pid
group mail
start program = "/usr/bin/sylph start "
as uid root and gid root
stop program = "/usr/bin/sylph stop"
as uid root and gid root
```````````````````````````````````````````````````````````
Now I really got confused.
--
View this message in context:
http://www.nabble.com/permision-problem--tf2968406.html#a8375798
Sent from the monit-general mailing list archive at Nabble.com.