Find the answer to your Linux question:
Results 1 to 3 of 3
Hay Sorry to a such a noob but I very new to the Linux seen (Very New) What I have got is an Arch Linux 3.1.4.1 installation I would like ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    1

    Question Startup a sh file a normal user on boot


    Hay

    Sorry to a such a noob but I very new to the Linux seen (Very New)

    What I have got is an Arch Linux 3.1.4.1 installation

    I would like to run a sh file that is in the

    /home/minecraft/svr/minecraft.sh

    Folder on boot

    This server will be visible over the internet and I donít want someone to be able to hack it and get root admin on my server so I would like to run the file as a normal user

    Go easy on the noob

    Thanks
    Dan

    If you need more info just ask

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    You can add a script to /etc/rc.d/ that will start up Minecraft (more on this in a moment). Look at other files in /etc/rc.d for an idea of how they work. You'll then have to add the script to the DAEMONS array in /etc/rc.conf.

    The Minecraft start script should, on start, run the command "sudo -u minecraft /path/to/script" (or "su -u minecraft - c /path/to/script", whichever you use). This will run the script as the given user (in this case, minecraft).

  3. #3
    Linux Newbie
    Join Date
    Aug 2010
    Posts
    232
    Add the script to /etc/rc.local/
    rc.local is for bash scripts and rc.d is for Daemons

Posting Permissions

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