Startup items and rc.*

Posted:
in macOS edited January 2014
EDIT: I surrender.



[ 02-18-2002: Message edited by: Neko-X ]</p>

Comments

  • Reply 1 of 11
    to create a startup item



    open system prefs

    open login prefs

    click the login items tab

    click add
  • Reply 2 of 11
    EDIT2: I surrender.



    [ 02-18-2002: Message edited by: Neko-X ]</p>
  • Reply 3 of 11
    eugeneeugene Posts: 8,254member
    creating a Start-up Item is rather complex. Just copy the structure of one of the other StartupItems.



    It may be easier for you to just stick it in an /etc/rc file...



    which basically amounts to adding the line:



    /path/to/hxd &



    to your file.
  • Reply 4 of 11
    torifiletorifile Posts: 4,024member
    Ok, I'm not sure that this will work but this is what I would recommend. Try at your own risk...



    1. edit /etc/hostconfig. Go down to the bottom and add a line that says something like: HXDSERVER =-YES-



    2. make a directory in /Library/StartUpItems called something like hxdserver.



    3. In this directory, create a file called hxdserver and add this code, making changes as appropriate.



    [code]

    #!/bin/sh



    ##

    # Start HXD Server

    ##



    . /etc/rc.common



    if [ "${HXDSERVER:=-NO-}" = "-YES-" ]; then

    ConsoleMessage "Starting Hotline server"



    /path/to/hxdserver

    fi

    </pre><hr></blockquote>



    4. Next create a file called StartupParameters.plist in this same directory witth the following text, making changes as appropriate.



    [code]

    {

    Description = "hotline server";

    Provides = ("HXD");

    Requires = ("Resolver");

    OrderPreference = "None";

    Messages =

    {

    start = "Starting hotline server";

    stop = "Stopping hotline server";

    };

    }





    </pre><hr></blockquote>





    I'm pretty sure that all of this will work except for the StartupParameters.plist line that says "provides..." Again, try at your own risk, but if it works please report back and let us know! Thanks. Also, if something goes awry, and you can't boot up, you can start in single user mode and just change the line in the /etc/hostconfig file to say HXDSERVER=-NO- and reboot. That should fix any problems that occur. HTH.



    [ 02-17-2002: Message edited by: torifile ]</p>
  • Reply 5 of 11
    EDIT: I surrender.



    [ 02-18-2002: Message edited by: Neko-X ]</p>
  • Reply 6 of 11
    eugeneeugene Posts: 8,254member
    Use the main rc file or source your own file in another one. I'd add it after SystemStarter.
  • Reply 7 of 11
    [quote]Originally posted by Eugene:

    <strong>Use the main rc file or source your own file in another one. I'd add it after SystemStarter.</strong><hr></blockquote>

    Fine...****it, if nobody can give me the correct FILENAME...then i give up.
  • Reply 8 of 11
    torifiletorifile Posts: 4,024member
    [quote]Originally posted by Neko-X:

    <strong>

    Fine...****it, if nobody can give me the correct FILENAME...then i give up.</strong><hr></blockquote>



    Did you even try my method? It should work and I'd try it if I had a need to. No reason to get huffy...jeez.
  • Reply 9 of 11
    [quote]Originally posted by torifile:

    <strong>



    Did you even try my method? It should work and I'd try it if I had a need to. No reason to get huffy...jeez.</strong><hr></blockquote>



    I know, but i do not want to do a startup item.
  • Reply 10 of 11
    torifiletorifile Posts: 4,024member
    [quote]Originally posted by Neko-X:

    <strong>



    I know, but i do not want to do a startup item.</strong><hr></blockquote>



    You do realize that this is not the same type of "startup item" that you get when you login right? This is one that happens at boot time, just like all the other services on your computer. Good luck, regardless. I'm sure someone will be able to answer your question. Have you tried <a href="http://www.macosxhints.com?"; target="_blank">www.macosxhints.com?</a> They've got lots of good info.
  • Reply 11 of 11
    torifiletorifile Posts: 4,024member
    The file you want to edit is /etc/rc.common . I have no idea what you want to do to it, maybe Eugene's tips will help.



    [edit: Have you tried to create a file in the /etc/ directory called rc.hxd? Maybe it will execute it if you add a line to the rc.common file telling it to. Look at that file and copy the syntax for where it says /etc/hostconfig and in the rc.hxd file put in the line Eugene suggested. If you don't know what I'm talking about or how to do it, you shouldn't be mucking around in /etc/ anyway. HTH.]



    [ 02-18-2002: Message edited by: torifile ]</p>
Sign In or Register to comment.