AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
Expand all | Collapse all

Init script for CUPS does not work except for "start"

  • 1.  Init script for CUPS does not work except for "start"

    Posted Thu March 29, 2018 02:17 AM

    Originally posted by: rc015116


    The CUPS init script (/etc/rc.d/init.d/cups) does not contain the code for finding the cupsd pid on AIX.  This causes the commands that interact with the running cupsd process to not work.  "reload" and "restart" both start a new cupsd process when there is already one running.  "status" always reports "scheduler is not running" whether cupsd is running or not.  "stop" does not stop cupsd.  Only "start" works.

     

    Below is my suggested fix for this.  The command that is used by other OSes to find the cupsd pid can also be used on AIX, so I added AIX to the list of compatible OSes.

     

    --- cups        2018-03-28 23:44:33.000000000 -0500
    +++ cups_new    2018-03-28 23:46:54.000000000 -0500
    @@ -132,7 +132,7 @@
            SunOS*)
                    pid=`ps -e | nawk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
                    ;;
    -       Linux* | *BSD* | Darwin*)
    +       Linux* | *BSD* | Darwin* | AIX*)
                    pid=`ps ax | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
                    ;;
            *)
    

     



  • 2.  Re: Init script for CUPS does not work except for "start"

    Posted Fri March 30, 2018 06:04 AM

    Originally posted by: sangameshm


    Hi Ray,

    Thanks for reporting the issue and providing suggested fix.
    We included the change and rebuilt CUPS. It will be uploaded in couple of days.

    Thanks,
    Sangamesh