Can't load daemon at boot

andris_at_multicom.lv
Date: 09/09/03

  • Next message: Forrest Aldrich: "Problems with latest CVS: Error: input: Resource temporarily unavailable"
    Date: Tue, 9 Sep 2003 18:42:53 +0300 (EEST)
    To: freebsd-stable@freebsd.org
    
    

    Hi!

    I have a programm with code like this (this is example, the real code is
    at
    http://fresh.t-systems-sfr.com/linux/src/.warix/logserial-0.4.2.tar.gz.html):

    ####################
    void shutdown(int sig) {
       switch (sig) {
           default:
               fprintf(stderr, "Got signal %d. Exit\n", sig);
               break;
       }
       exit(EXIT_SUCCESS);
    }

    int main(void) {
       chproc = fork();
       if (chproc == -1) {
           perror("Unable to fork");
           exit(EXIT_FAILURE);
       }
       if (chproc != 0) {
           fprintf(stderr, "Starting daemon...\n");
           exit(EXIT_SUCCESS);
       }

       signal(SIGHUP, &shutdown);
       signal(SIGINT, &shutdown);
       signal(SIGQUIT, &shutdown);
       signal(SIGTERM, &shutdown);
       signal(SIGABRT, &shutdown);

       while (1) {
           sleep(1);
       }

       return 0;
    }
    ####################

    When I load a.out from terminal it run fine.
    I want this programm run at every boot so I place this command in
    /etc/rc.local or /usr/local/etc/rc.d/prog.sh.
    After boot it not run and in logs I see message "Got signal 1. Exit".

    Any ideas?

    Andris

    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


  • Next message: Forrest Aldrich: "Problems with latest CVS: Error: input: Resource temporarily unavailable"

    Relevant Pages

    • SP2 Dismounting Volumes in a Hibernate Once/Resume Many Configurat
      ... If tried to write a programm as discribed in the following technical article: ... If i try to unlock the volume manually after boot from the hibernate state, ... after boot from the hibernatefile unlock the partitons again. ...
      (microsoft.public.windowsxp.embedded)
    • Re: Re-updated to RISC OS 4.02
      ... All I have done is to install the new!Boot, ... there was to install some other software, ... I could not find any installed PPP-driver oder dial-in programm ... path as in the old!Boot doesn't work anymore. ...
      (comp.sys.acorn.misc)
    • Re: Nachrichten an andere Progarmme senden ?
      ... Aber ich kann mich gut daran erinnern das man nicht mit "findwindow" arbeiten sollte um das andere Programm zu finden. ... FAQ: http://www.mpdvc.de Privat: http://www.schikos.de/MFC.html Motorrad als Boot: http://bootorrad.de ...
      (microsoft.public.de.vc)