Fix for to the startup service problem on upgrade.

Fix for circular dependency between CASA and Gnome Keyring.
Fix for yast grey out button.
This commit is contained in:
Cameron (Kamran) Mashayekhi
2006-05-22 21:14:34 +00:00
parent a601b19764
commit 0e2f327e7c
22 changed files with 339 additions and 190 deletions

View File

@@ -1,5 +1,6 @@
#!/bin/bash
# Adding CASA pam entries to pam files.
rm -f *.rpmsave
for file in "/etc/pam.d/login" "/etc/pam.d/sshd" "/etc/pam.d/xdm" "/etc/pam.d/gdm" "/etc/pam.d/kdm"
do
if [ -f $file ]

View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -x
#
CFG=`rpm -qa |grep -i ^casa-[1-9]`
if [ "$CFG" != "" ]
then
PAM=`find /etc/pam.d -exec grep -i casa \{\} \;`
if [ "$PAM" != "" ]
then
exit 0
else
exit 1
fi
else
exit 1
fi

View File

@@ -11,10 +11,8 @@
# Short-Description: miCASA daemon
# Description: miCASA daemon
### END INIT INFO
MICASAD_BIN=/usr/sbin/micasad.sh
MICASAD_PID=/var/run/micasad.pid
MICASAD_MONO=/usr/bin/mono
MICASAD_BIN=/usr/sbin/micasad.sh
test -x $MICASAD_BIN || exit 5
. /etc/rc.status
@@ -31,16 +29,39 @@ test -x $MICASAD_BIN || exit 5
# First reset status of this service
rc_reset
function pid_exists()
{
test -f /var/run/micasad.pid 2> /dev/null
}
function process_running()
{
kill -0 `cat /var/run/micasad.pid` 2> /dev/null
}
function is_running()
{
pid_exists && process_running
}
case "$1" in
start)
echo "Starting miCASA daemon"
/sbin/startproc -f $MICASAD_BIN
if ! is_running; then \
echo -n "Starting miCASA daemon"
$MICASAD_BIN
fi
# Remember status and be verbose
rc_status -v
;;
stop)
echo "Shutting down micasad "
killproc -p $MICASAD_PID -TERM $MICASAD_MONO
if is_running; then \
echo -n "Shutting down miCASA daemon"
#killproc -TERM $MICASAD_BIN
pid=`cat /var/run/micasad.pid` >/dev/null 2>&1
kill -s TERM $pid >/dev/null 2>&1
fi
# Remember status and be verbose
rc_status -v
@@ -87,8 +108,12 @@ case "$1" in
rc_status
;;
status)
echo "Checking micasad service ..."
checkproc -p $MICASAD_PID $MICASAD_BIN
echo -n "Checking miCASA daemon"
if pid_exists && ! process_running 2> /dev/null; then \
rc_failed 1
elif ! pid_exists && ! process_running 2> /dev/null; then \
rc_failed 3
fi
rc_status -v
;;

View File

@@ -0,0 +1,39 @@
#include <unistd.h>
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
main(int argc, char *argv[])
{
int no_fds = 0;
int fd = -1;
int rc = 0;
pid_t sid;
/*
* Fork a child process
* Exit parent
* Change directory to "/"
* Redirect stdin, stdout, stderr to "/dev/null"
*/
rc = daemon (0, 0);
if ( rc < 0 )
{
exit(EXIT_FAILURE);
}
/* Create a new session */
setsid();
/* Set the file mode creation mask */
umask(022);
/* Close the associated standard file descriptors */
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
/* Start micasad */
return execv ("/usr/bin/mono", argv);
}

View File

@@ -8,4 +8,4 @@ fi
export MONO_PATH=/usr/lib$ARCH_LIB/
mono /usr/bin/micasad.exe
exec /usr/sbin/micasad-init /usr/bin/micasad.exe