Professional Web Applications Themes

Trouble Runinng Fink's Apache Package as Startup Item - Mac Applications & Software

I recently installed fink's apache package, and I'm trying to get it to start at boot time, but not having much luck. The first thing I tried was putting reboot /sw/sbin/apachectl restart in /etc/crontab, but that didn't seem to work, so I tried the long route, installing it in StartupItems. I have the following: /Library/StartupItems/Apache% ls -l total 8 drwx------ 5 adavies staff 170 Aug 15 23:02 . drwxrwxr-x 11 root wheel 374 Aug 13 22:01 .. -rwx------ 1 adavies staff 362 Aug 13 22:02 Apache drwx------ 4 adavies staff 136 Aug 13 21:58 Resources -rw------- 1 adavies staff 206 ...

  1. #1

    Default Trouble Runinng Fink's Apache Package as Startup Item

    I recently installed fink's apache package, and I'm trying to get it to
    start at boot time, but not having much luck. The first thing I tried
    was putting

    reboot /sw/sbin/apachectl restart

    in /etc/crontab, but that didn't seem to work, so I tried the long
    route, installing it in StartupItems. I have the following:

    /Library/StartupItems/Apache% ls -l
    total 8
    drwx------ 5 adavies staff 170 Aug 15 23:02 .
    drwxrwxr-x 11 root wheel 374 Aug 13 22:01 ..
    -rwx------ 1 adavies staff 362 Aug 13 22:02 Apache
    drwx------ 4 adavies staff 136 Aug 13 21:58 Resources
    -rw------- 1 adavies staff 206 Aug 13 21:58 StartupParameters.plist

    and the contents of Apache are

    #!/bin/sh

    ##
    # Apache HTTP Server
    ##

    .. /etc/rc.common
    .. /sw/bin/init.sh

    StartService ()
    {
    ConsoleMessage "Starting Apache web server"
    apachectl start
    }

    StopService ()
    {
    ConsoleMessage "Stopping Apache web server"
    apachectl stop
    }

    RestartService ()
    {
    ConsoleMessage "Restarting Apache web server"
    apachectl restart
    }

    RunService "$1"

    StartupParameters.plist has

    {
    Description = "Apache web server";
    Provides = ("Web Server");
    Requires = ("DirectoryServices");
    Uses = ("Disks", "NFS", "Network Time");
    OrderPreference = "None";
    }

    If I say

    sudo /Library/StartupItems/Apache/Apache start

    in Terminal, it works fine, but it doesn't start when I start the
    computer. What's wrong? Incidentally, I added the

    .. /sw/bin/init.sh

    line to source the fink script because I was having path problems trying
    to run the Apache script.
    --
    Aaron Davies
    Opinions expressed are solely those of a random number generator.
    "I don't know if it's real or not but it is a myth."
    -Jami JoAnne of alt.folklore.urban, showing her grasp on reality.

    Aaron Guest

  2. #2

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    Hello . . . hello . . . hello . . . is there anybody out there?

    Aaron Davies <pascal-central.com> wrote:
     


    --
    Aaron Davies
    Opinions expressed are solely those of a random number generator.
    "I don't know if it's real or not but it is a myth."
    -Jami JoAnne of alt.folklore.urban, showing her grasp on reality.

    Aaron Guest

  3. #3

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    Aaron Davies <pascal-central.com> wrote: 

    In your script, I would try to specify the full path name to apachectl
    even though you're sourcing /sw/bin/init.sh. I'm not using apache
    from fink, I compiled my own apache2 and here is my startup script
    that works fine (I added APACHE2 to /etc/hostconfig for switching
    it on an off):


    #!/bin/sh

    ##
    # Apache HTTP Server
    ##

    .. /etc/rc.common

    StartService ()
    {
    if [ "${APACHE2:=-NO-}" = "-YES-" ]; then
    ConsoleMessage "Starting Apache2 web server"
    /usr/local/apache2/bin/apachectl startssl
    fi
    }

    StopService ()
    {
    ConsoleMessage "Stopping Apache web server"
    /usr/local/apache2/bin/apachectl stop
    }

    RestartService ()
    {
    if [ "${APACHE2:=-NO-}" = "-YES-" ]; then
    ConsoleMessage "Restarting Apache web server"
    /usr/local/apache2/apachectl restart
    else
    StopService
    fi
    }

    RunService "$1"

    regards
    --
    John J. Rushford
    j j r { a t } a l i s a { d o t } o r g
    http://www.cs.du.edu/~jjr
    read-the-signature@send-spam-to-dev-null.com Guest

  4. #4

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    g<com> wrote:
     


    --
    Aaron Davies
    Opinions expressed are solely those of a random number generator.
    "I don't know if it's real or not but it is a myth."
    -Jami JoAnne of alt.folklore.urban, showing her grasp on reality.

    Aaron Guest

  5. #5

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    <com> wrote:
     
    >
    > In your script, I would try to specify the full path name to apachectl
    > even though you're sourcing /sw/bin/init.sh. I'm not using apache
    > from fink, I compiled my own apache2 and here is my startup script
    > that works fine (I added APACHE2 to /etc/hostconfig for switching
    > it on an off):[/ref]

    Thanks, I've implemented that and I'll give it a try next reboot. I'm
    actually moving in a couple days, so I'll see then, if not before. I try
    to avoid rebooting when I don't have to. :)
    --
    Aaron Davies
    Opinions expressed are solely those of a random number generator.
    "I don't know if it's real or not but it is a myth."
    -Jami JoAnne of alt.folklore.urban, showing her grasp on reality.

    Aaron Guest

  6. #6

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    Aaron Davies <pascal-central.com> wrote:
     
    > >
    > > In your script, I would try to specify the full path name to apachectl
    > > even though you're sourcing /sw/bin/init.sh. I'm not using apache
    > > from fink, I compiled my own apache2 and here is my startup script
    > > that works fine (I added APACHE2 to /etc/hostconfig for switching
    > > it on an off):[/ref]
    >
    > Thanks, I've implemented that and I'll give it a try next reboot. I'm
    > actually moving in a couple days, so I'll see then, if not before. I try
    > to avoid rebooting when I don't have to. :)[/ref]

    Still doesn't seem to be working. I now have the following in hostconfig
    and the startup script. Any other ideas?

    ~% grep -i apache /etc/hostconfig
    APACHE=-YES-

    ~% cat /Library/StartupItems/Apache/Apache
    #!/bin/sh

    ##
    # Apache HTTP Server
    ##

    .. /etc/rc.common
    .. /sw/bin/init.sh

    StartService ()
    {
    if [ "${APACHE:=-NO-}" = "-YES-" ]; then
    ConsoleMessage "Starting Apache web server"
    /sw/sbin/apachectl start
    fi
    }

    StopService ()
    {
    ConsoleMessage "Stopping Apache web server"
    /sw/sbin/apachectl stop
    }

    RestartService ()
    {
    if [ "${APACHE:=-NO-}" = "-YES-" ]; then
    ConsoleMessage "Restarting Apache web server"
    /sw/sbin/apachectl restart
    else
    StopService
    fi
    }

    RunService "$1"
    --
    Aaron Davies
    Opinions expressed are solely those of a random number generator.
    "I don't know if it's real or not but it is a myth."
    -Jami JoAnne of alt.folklore.urban, showing her grasp on reality.

    Aaron Guest

  7. #7

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    Aaron Davies <pascal-central.com> wrote:
     
    > >
    > > Thanks, I've implemented that and I'll give it a try next reboot. I'm
    > > actually moving in a couple days, so I'll see then, if not before. I try
    > > to avoid rebooting when I don't have to. :)[/ref]
    >
    > Still doesn't seem to be working. I now have the following in hostconfig
    > and the startup script. Any other ideas?
    >
    > ~% grep -i apache /etc/hostconfig
    > APACHE=-YES-
    >
    > ~% cat /Library/StartupItems/Apache/Apache
    > #!/bin/sh
    >
    > ##
    > # Apache HTTP Server
    > ##
    >
    > . /etc/rc.common
    > . /sw/bin/init.sh
    >
    > StartService ()
    > {
    > if [ "${APACHE:=-NO-}" = "-YES-" ]; then
    > ConsoleMessage "Starting Apache web server"
    > /sw/sbin/apachectl start
    > fi
    > }
    >
    > StopService ()
    > {
    > ConsoleMessage "Stopping Apache web server"
    > /sw/sbin/apachectl stop
    > }
    >
    > RestartService ()
    > {
    > if [ "${APACHE:=-NO-}" = "-YES-" ]; then
    > ConsoleMessage "Restarting Apache web server"
    > /sw/sbin/apachectl restart
    > else
    > StopService
    > fi
    > }
    >
    > RunService "$1"[/ref]

    Hello? Anybody? It's still not working.
    --
    Aaron Davies
    Opinions expressed are solely those of a random number generator.
    "I don't know if it's real or not but it is a myth."
    -Jami JoAnne of alt.folklore.urban, showing her grasp on reality.
    Aaron Guest

  8. #8

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    In article <1g0m6ml.1dy15xm1f60rk0N%pascal-central.com>,
    pascal-central.com (Aaron Davies) wrote:
     [/ref]
    <SNIP>
     

    Um, do you have the Resources directory and the StartupParameters.plist
    file in your startupitem folder? Are you sure you need that .
    /sw/bin/init.sh ?

    --
    Heath
    __________________________________________________ ______
    | *Nothing is foolproof to a sufficiently talented fool* |
    | _\|/_ |
    |________________________________________m(. .)m_________|
    Heath Guest

  9. #9

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    Heath Raftery <com> wrote:
     [/ref]
    > <SNIP>

    >
    > Um, do you have the Resources directory and the StartupParameters.plist
    > file in your startupitem folder? Are you sure you need that .
    > /sw/bin/init.sh ?[/ref]

    I put the init.sh in 'cause it couldn't find the right apachectl. Since
    I've given it the full path, I'll try commenting out the init.sh, but I
    doubt it will help. All that script does is set up a bunch of paths for
    Fink. Here's the contents of the Apache item folder. Is there anything
    missing?

    ~% cd /Library/StartupItems/Apache
    /Library/StartupItems/Apache% ls -lR
    ..:
    total 12
    drwx------ 6 adavies staff 204 Aug 21 03:02 .
    drwxrwxr-x 11 root wheel 374 Aug 13 23:01 ..
    -rwx------ 1 adavies staff 504 Aug 21 03:02 Apache
    -rwx------ 1 root staff 404 Aug 21 02:59 Apache~
    drwx------ 4 adavies staff 136 Aug 13 22:58 Resources
    -rw------- 1 adavies staff 206 Aug 13 22:58
    StartupParameters.plist

    Resources:
    total 0
    drwx------ 4 adavies staff 136 Aug 13 22:58 .
    drwx------ 6 adavies staff 204 Aug 21 03:02 ..
    drwx------ 3 adavies staff 102 Aug 13 22:58 English.lproj
    drwx------ 3 adavies staff 102 Aug 13 22:58 Japanese.lproj

    Resources/English.lproj:
    total 4
    drwx------ 3 adavies staff 102 Aug 13 22:58 .
    drwx------ 4 adavies staff 136 Aug 13 22:58 ..
    -rw------- 1 adavies staff 422 Aug 13 22:58
    Localizable.strings

    Resources/Japanese.lproj:
    total 4
    drwx------ 3 adavies staff 102 Aug 13 22:58 .
    drwx------ 4 adavies staff 136 Aug 13 22:58 ..
    -rw------- 1 adavies staff 440 Aug 13 22:58
    Localizable.strings
    --
    Aaron Davies
    Opinions expressed are solely those of a random number generator.
    "I don't know if it's real or not but it is a myth."
    -Jami JoAnne of alt.folklore.urban, showing her grasp on reality.
    Aaron Guest

  10. #10

    Default Re: Trouble Runinng Fink's Apache Package as Startup Item

    Aaron Davies <pascal-central.com> wrote: 
     
    >>
    >> Um, do you have the Resources directory and the StartupParameters.plist
    >> file in your startupitem folder? Are you sure you need that .
    >> /sw/bin/init.sh ?[/ref][/ref]
     

    Yeah, I agree it is unlikely to cause a problem. I just thought it was the
    only thing different to other StartupItems that I could see and that it was
    probably not necessary.
     

    No, that looks fine.
    Apologies for not reading the start of the thread - I see what you've done
    now. The next thing I would try would probably be the permissions of the
    files in that directory. It would seem odd that the boot process couldn't
    execute your script, but still, you may want to imitate the permissions in
    other StartupItems. I'm pretty sure all this stuff is doented somewhere,
    but not sure off the top of the head. Compare the permissions of say, the
    Sendmail StartupItem to your own:

    drwxr-xr-x 3 root wheel 102 Jul 28 2002 Resources
    -rwxr-xr-x 1 root wheel 1044 Jul 28 2002 Sendmail
    -rw-r--r-- 1 root wheel 203 Jul 28 2002 StartupParameters.plist

    You might need to make your files world executable.

    Hope that helps.
    --
    *--------------------------------------------------------*
    | ^Nothing is foolproof to a sufficiently talented fool^ |
    | Heath Raftery, HRSoftWorks _\|/_ |
    *______________________________________m_('.')_m__ _______*
    Heath Guest

Similar Threads

  1. Replies: 3
    Last Post: December 3rd, 05:13 PM
  2. Problem Runinng Applications
    By Manu in forum Windows Server
    Replies: 0
    Last Post: June 14th, 04:15 PM
  3. apache conflicts with files from package httpd-2.0.40-21
    By William in forum Linux Setup, Configuration & Administration
    Replies: 6
    Last Post: November 10th, 02:44 AM
  4. Apache::ASP Package (PM) refresh problem
    By Islaw in forum PERL Miscellaneous
    Replies: 1
    Last Post: August 11th, 09:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139