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:
39
c_micasad/startup/micasad-init.c
Normal file
39
c_micasad/startup/micasad-init.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user