[Nut-upsdev] [nut-commits] svn commit r1837 - trunk/clients

Charles Lepple clepple at gmail.com
Tue May 5 02:08:08 UTC 2009


oops, this wasn't supposed to make it into the trunk yet. I can revert
it until further testing, but has anyone else tried running with this
patch?

http://lists.alioth.debian.org/pipermail/nut-upsdev/2009-April/003821.html

On Mon, May 4, 2009 at 10:05 PM, Charles Lepple
<clepple-guest at alioth.debian.org> wrote:
> Author: clepple-guest
> Date: Tue May  5 02:05:09 2009
> New Revision: 1837
>
> Log:
> upslog patch for PID basename
>
> Modified:
>   trunk/clients/upslog.c
>
> Modified: trunk/clients/upslog.c
> ==============================================================================
> --- trunk/clients/upslog.c      Tue May  5 01:32:47 2009        (r1836)
> +++ trunk/clients/upslog.c      Tue May  5 02:05:09 2009        (r1837)
> @@ -109,6 +109,7 @@
>        printf("                - Use -f \"<format>\" so your shell doesn't break it up.\n");
>        printf("  -i <interval> - Time between updates, in seconds\n");
>        printf("  -l <logfile>  - Log file name, or - for stdout\n");
> +       printf("  -p <pidbase>  - Base name for PID file (defaults to \"upslog\")\n");
>        printf("  -s <ups>      - Monitor UPS <ups> - <upsname>@<host>[:<port>]\n");
>        printf("                - Example: -s myups at server\n");
>        printf("  -u <user>     - Switch to <user> if started as root\n");
> @@ -372,6 +373,7 @@
>        time_t  now, nextpoll = 0;
>        const   char    *user = NULL;
>        struct  passwd  *new_uid = NULL;
> +       const   char    *pidfilebase = "upslog";
>
>        logformat = DEFAULT_LOGFORMAT;
>        user = RUN_AS_USER;
> @@ -380,7 +382,7 @@
>
>        prog = argv[0];
>
> -       while ((i = getopt(argc, argv, "+hs:l:i:f:u:V")) != -1) {
> +        while ((i = getopt(argc, argv, "+hs:l:i:f:u:Vp:")) != -1) {
>                switch(i) {
>                        case 'h':
>                                help(prog);
> @@ -408,6 +410,10 @@
>
>                        case 'V':
>                                exit(EXIT_SUCCESS);
> +
> +                       case 'p':
> +                               pidfilebase = optarg;
> +                               break;
>                }
>        }
>
> @@ -477,7 +483,7 @@
>
>        setup_signals();
>
> -       writepid("upslog");
> +       writepid(pidfilebase);
>
>        become_user(new_uid);
>
>
> _______________________________________________
> nut-commits mailing list
> nut-commits at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-commits
>



-- 
- Charles Lepple



More information about the Nut-upsdev mailing list