supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* kdm not working in run script
@ 2004-09-30 17:21 John Nielsen
  2004-09-30 19:34 ` kdm not working in run script - SOLVED!! John Nielsen
  0 siblings, 1 reply; 10+ messages in thread
From: John Nielsen @ 2004-09-30 17:21 UTC (permalink / raw)


Hi guys,

Im having a problem starting kdm from a run script.

When I run kdm from the console it works fine, but when I start it from the 
run script, it just starts reloading in a loop without outputting anything.

I tried to use the xdm example run file from the runit page and used that as a 
template, but no dice. 

Does anyone here have a working run script for kdm they can share?

At this point, any RTFM pointers will be most appreciated.

Thanks.

John


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kdm not working in run script - SOLVED!!
  2004-09-30 17:21 kdm not working in run script John Nielsen
@ 2004-09-30 19:34 ` John Nielsen
  2004-09-30 19:41   ` Paul Jarc
  0 siblings, 1 reply; 10+ messages in thread
From: John Nielsen @ 2004-09-30 19:34 UTC (permalink / raw)


On Thursday 30 September 2004 19:21, John Nielsen wrote:
> Hi guys,
>
> Im having a problem starting kdm from a run script.
>
> When I run kdm from the console it works fine, but when I start it from the
> run script, it just starts reloading in a loop without outputting anything.
>
> I tried to use the xdm example run file from the runit page and used that
> as a template, but no dice.
>
> Does anyone here have a working run script for kdm they can share?
>
> At this point, any RTFM pointers will be most appreciated.

I solved the problem.

It turns out that if I just put in 'kdm' in the script, it wont work. I needed 
to put in the full path to make it work. I have installed KDE in a non 
standart folder. Maybe that has something to do with it? Im not really sure 
what, since kdm is still in my path. 

John


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kdm not working in run script - SOLVED!!
  2004-09-30 19:34 ` kdm not working in run script - SOLVED!! John Nielsen
@ 2004-09-30 19:41   ` Paul Jarc
  2004-10-01 19:24     ` John Nielsen
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Jarc @ 2004-09-30 19:41 UTC (permalink / raw)
  Cc: supervision

John Nielsen <knoglen@tele2.fr> wrote:
> Im not really sure what, since kdm is still in my path.

It's in *your* $PATH, but is it in runit's?
$ tr \\0 \\n < /proc/$pid/environ | grep \^PATH=

(Or add 'echo "PATH=$PATH"' to your run script and look for that in
the log.)


paul


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kdm not working in run script - SOLVED!!
  2004-09-30 19:41   ` Paul Jarc
@ 2004-10-01 19:24     ` John Nielsen
  2004-10-01 19:27       ` John Nielsen
  2004-10-01 19:31       ` Charlie Brady
  0 siblings, 2 replies; 10+ messages in thread
From: John Nielsen @ 2004-10-01 19:24 UTC (permalink / raw)


On Thursday 30 September 2004 21:41, Paul Jarc wrote:
> John Nielsen <knoglen@tele2.fr> wrote:
> > Im not really sure what, since kdm is still in my path.
>
> It's in *your* $PATH, but is it in runit's?
> $ tr \\0 \\n < /proc/$pid/environ | grep \^PATH=
>
> (Or add 'echo "PATH=$PATH"' to your run script and look for that in
> the log.)

You are right. Indeed kdm was not in the runit path. I guess I still have to 
get used to the services being managed like that.

This sheltered life of the daemons however seems to be causing me some 
problems however.

When I try to shut down the pc, it  


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kdm not working in run script - SOLVED!!
  2004-10-01 19:24     ` John Nielsen
@ 2004-10-01 19:27       ` John Nielsen
  2004-10-01 19:31       ` Charlie Brady
  1 sibling, 0 replies; 10+ messages in thread
From: John Nielsen @ 2004-10-01 19:27 UTC (permalink / raw)


On Friday 01 October 2004 21:24, John Nielsen wrote:
> On Thursday 30 September 2004 21:41, Paul Jarc wrote:
> > John Nielsen <knoglen@tele2.fr> wrote:
> > > Im not really sure what, since kdm is still in my path.
> >
> > It's in *your* $PATH, but is it in runit's?
> > $ tr \\0 \\n < /proc/$pid/environ | grep \^PATH=
> >
> > (Or add 'echo "PATH=$PATH"' to your run script and look for that in
> > the log.)
>
> You are right. Indeed kdm was not in the runit path. I guess I still have
> to get used to the services being managed like that.
>
> This sheltered life of the daemons however seems to be causing me some
> problems however.
>
> When I try to shut down the pc, it

Aaargh....

When i try to shut down the pc, it wont run the /sbin/halt and /sbin/reboot 
commands (I have them symlinked to init 0 and init 6). Well yes, it runs 
them, but it only returns me to the prompt. It doesnt actueally reboot or 
halt the pc. Im not entirely sure what is going on here since this works fine 
from the getties which are allso run from within a run script.

Any ideas?

John


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kdm not working in run script - SOLVED!!
  2004-10-01 19:24     ` John Nielsen
  2004-10-01 19:27       ` John Nielsen
@ 2004-10-01 19:31       ` Charlie Brady
  2004-10-01 20:12         ` John Nielsen
  1 sibling, 1 reply; 10+ messages in thread
From: Charlie Brady @ 2004-10-01 19:31 UTC (permalink / raw)
  Cc: supervision


On Fri, 1 Oct 2004, John Nielsen wrote:

> This sheltered life of the daemons however seems to be causing me some 
> problems however.

Whatever problems it might be causing you now will be more than repaid by 
the problems it will save you over the life of your systems. Having an 
entirely predictable and controlled environments in which daemons run is a 
very good thing indeed.

---
Charlie



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kdm not working in run script - SOLVED!!
  2004-10-01 19:31       ` Charlie Brady
@ 2004-10-01 20:12         ` John Nielsen
  2004-10-03  2:29           ` Vincent Danen
  0 siblings, 1 reply; 10+ messages in thread
From: John Nielsen @ 2004-10-01 20:12 UTC (permalink / raw)


On Friday 01 October 2004 21:31, Charlie Brady wrote:
> On Fri, 1 Oct 2004, John Nielsen wrote:
> > This sheltered life of the daemons however seems to be causing me some
> > problems however.
>
> Whatever problems it might be causing you now will be more than repaid by
> the problems it will save you over the life of your systems. Having an
> entirely predictable and controlled environments in which daemons run is a
> very good thing indeed.

Heh, dont worry... I am allready more than completely sold.

Quite frankely I cant for the life of me imagine why I have never seen any 
distros using a managed boot system like runits. Runit has really showed me 
that sysvinit doesnt really contain much more than what I could code in bash 
in a few afternoons.

My biggest problem right now is that this way of doing things is still new to 
me and I find myself having to tear down a lot of assumptions about how linux 
works. Runit is turning out to be a great learning experience for me. 

I did a few tests and I dont think the problem im having shutting down is 
caused by runit. It shuts down fine when I run 'init 0' from a konsole. Lets 
see if google can help me with this. If not, ill find a KDE list and ask for 
help there.

Thanks for your help on this. This list is turning out to be friendlier than 
most.

John


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: kdm not working in run script - SOLVED!!
  2004-10-01 20:12         ` John Nielsen
@ 2004-10-03  2:29           ` Vincent Danen
  2004-10-03 17:05             ` supervising autofs (was Re: kdm not working in run script - SOLVED!!) Charlie Brady
  0 siblings, 1 reply; 10+ messages in thread
From: Vincent Danen @ 2004-10-03  2:29 UTC (permalink / raw)
  Cc: supervision

[-- Attachment #1: Type: text/plain, Size: 1473 bytes --]


On 1-Oct-04, at 2:12 PM, John Nielsen wrote:

>>> This sheltered life of the daemons however seems to be causing me 
>>> some
>>> problems however.
>>
>> Whatever problems it might be causing you now will be more than 
>> repaid by
>> the problems it will save you over the life of your systems. Having an
>> entirely predictable and controlled environments in which daemons run 
>> is a
>> very good thing indeed.
>
> Heh, dont worry... I am allready more than completely sold.
>
> Quite frankely I cant for the life of me imagine why I have never seen 
> any
> distros using a managed boot system like runits. Runit has really 
> showed me
> that sysvinit doesnt really contain much more than what I could code 
> in bash
> in a few afternoons.

Annvix uses runit... I'm not aware of any others that do, but Annvix 
uses it completely out of the box.  The only service that is not run 
under runit is autofs, which I still have to figure out.  A few others 
are causing me some grief, but for the most part it is incredibly 
reliable.  (Note that I just switched from using daemontools to runit 
it for the distro about 2-3 weeks ago and the transition was fairly 
smooth although there are still a few things left to do).

-- 
Annvix - Secure Linux Server: http://annvix.org/
*Please note gpg keyid FE6F2AFD has been replaced with keyid FEE30AD4*
"lynx -source http://linsec.ca/vdanen.asc | gpg --import"
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* supervising autofs (was Re: kdm not working in run script - SOLVED!!)
  2004-10-03  2:29           ` Vincent Danen
@ 2004-10-03 17:05             ` Charlie Brady
  2004-10-04 19:01               ` Vincent Danen
  0 siblings, 1 reply; 10+ messages in thread
From: Charlie Brady @ 2004-10-03 17:05 UTC (permalink / raw)
  Cc: John Nielsen, supervision


On Sat, 2 Oct 2004, Vincent Danen wrote:

> Annvix uses runit... I'm not aware of any others that do, but Annvix 
> uses it completely out of the box.  The only service that is not run 
> under runit is autofs, which I still have to figure out.

I think this patch (untested) will give you the -f option you need:

--- autofs-4.0.0pre10/daemon/automount.c.orig	2004-08-22 19:40:30.000000000 -0400
+++ autofs-4.0.0pre10/daemon/automount.c	2004-08-22 20:03:44.000000000 -0400
@@ -1143,7 +1143,7 @@
   return -1;
 }
 
-static void become_daemon(void)
+static void become_daemon(int foreground)
 {
   FILE *pidfp;
   pid_t pid;
@@ -1153,7 +1153,7 @@
   chdir("/");
   
   /* Detach from foreground process */
-  if ( !submount ) {
+  if ( !submount && !foreground) {
     pid = fork();
     if ( pid > 0 )
       exit(0);
@@ -1248,6 +1248,7 @@
   const char **mapargv;
   struct sigaction sa;
   int mapargc, opt;
+  int foreground = 0;
   static const struct option long_options[] = {
     {"help",     0, 0, 'h'},
     {"pid-file", 1, 0, 'p'},
@@ -1263,12 +1264,15 @@
   ap.exp_timeout = DEFAULT_TIMEOUT;
   
   opterr = 0;
-  while ( (opt = getopt_long(argc, argv, "+hp:t:v", long_options,
+  while ( (opt = getopt_long(argc, argv, "+hp:t:v:f", long_options,
 			     NULL)) != EOF ) {
     switch( opt ) {
     case 'h':
       usage();
       exit(0);
+    case 'f':
+      foreground++;
+      break;
     case 'p':
       pid_file = optarg;
       break;
@@ -1299,7 +1303,7 @@
     exit(1);
   }
   
-  become_daemon();
+  become_daemon(foreground);
   
   path    = argv[0];
   map     = argv[1];



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: supervising autofs (was Re: kdm not working in run script - SOLVED!!)
  2004-10-03 17:05             ` supervising autofs (was Re: kdm not working in run script - SOLVED!!) Charlie Brady
@ 2004-10-04 19:01               ` Vincent Danen
  0 siblings, 0 replies; 10+ messages in thread
From: Vincent Danen @ 2004-10-04 19:01 UTC (permalink / raw)
  Cc: John Nielsen, supervision

[-- Attachment #1: Type: text/plain, Size: 2276 bytes --]


On 3-Oct-04, at 11:05 AM, Charlie Brady wrote:

>
> On Sat, 2 Oct 2004, Vincent Danen wrote:
>
>> Annvix uses runit... I'm not aware of any others that do, but Annvix
>> uses it completely out of the box.  The only service that is not run
>> under runit is autofs, which I still have to figure out.
>
> I think this patch (untested) will give you the -f option you need:

Yeah, you sent me that a while ago (and I still have to try it although 
now I'm trying to nail down some mysql and ldap issues).  I really need 
to get this applied and try to convert a really nasty initscript to a 
run script (this patch is likely the easiest part).

> --- autofs-4.0.0pre10/daemon/automount.c.orig	2004-08-22 
> 19:40:30.000000000 -0400
> +++ autofs-4.0.0pre10/daemon/automount.c	2004-08-22 20:03:44.000000000 
> -0400
> @@ -1143,7 +1143,7 @@
>    return -1;
>  }
>
> -static void become_daemon(void)
> +static void become_daemon(int foreground)
>  {
>    FILE *pidfp;
>    pid_t pid;
> @@ -1153,7 +1153,7 @@
>    chdir("/");
>
>    /* Detach from foreground process */
> -  if ( !submount ) {
> +  if ( !submount && !foreground) {
>      pid = fork();
>      if ( pid > 0 )
>        exit(0);
> @@ -1248,6 +1248,7 @@
>    const char **mapargv;
>    struct sigaction sa;
>    int mapargc, opt;
> +  int foreground = 0;
>    static const struct option long_options[] = {
>      {"help",     0, 0, 'h'},
>      {"pid-file", 1, 0, 'p'},
> @@ -1263,12 +1264,15 @@
>    ap.exp_timeout = DEFAULT_TIMEOUT;
>
>    opterr = 0;
> -  while ( (opt = getopt_long(argc, argv, "+hp:t:v", long_options,
> +  while ( (opt = getopt_long(argc, argv, "+hp:t:v:f", long_options,
>  			     NULL)) != EOF ) {
>      switch( opt ) {
>      case 'h':
>        usage();
>        exit(0);
> +    case 'f':
> +      foreground++;
> +      break;
>      case 'p':
>        pid_file = optarg;
>        break;
> @@ -1299,7 +1303,7 @@
>      exit(1);
>    }
>
> -  become_daemon();
> +  become_daemon(foreground);
>
>    path    = argv[0];
>    map     = argv[1];
>
>

-- 
Annvix - Secure Linux Server: http://annvix.org/
*Please note gpg keyid FE6F2AFD has been replaced with keyid FEE30AD4*
"lynx -source http://linsec.ca/vdanen.asc | gpg --import"
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-10-04 19:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-30 17:21 kdm not working in run script John Nielsen
2004-09-30 19:34 ` kdm not working in run script - SOLVED!! John Nielsen
2004-09-30 19:41   ` Paul Jarc
2004-10-01 19:24     ` John Nielsen
2004-10-01 19:27       ` John Nielsen
2004-10-01 19:31       ` Charlie Brady
2004-10-01 20:12         ` John Nielsen
2004-10-03  2:29           ` Vincent Danen
2004-10-03 17:05             ` supervising autofs (was Re: kdm not working in run script - SOLVED!!) Charlie Brady
2004-10-04 19:01               ` Vincent Danen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).