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
|
SUDO Instructions:
------------------
"sudo" is a command that can make your life much simpler. After you set
it up that is! By adding a couple of lines to your /etc/sudoers file
(using the "visudo" command to edit this file), you'll be able to run a few
commands as root without having to type the root password each time.
Another thing you can do at that point is automate the entire
"git pull; mkdir -p build; cd build; ../configure; su; make install"
process via a script. Here's how to set all of this up:
Type "su" to become the root user, then type "visudo". This will bring up
the "vi" editor on the /etc/sudoers file. If you'd like to learn more
about what I'm going to describe, type "man sudoers" in another window and
read about this file. Another man-page that is useful here is the "man
sudo" page.
Back to the editing: There's a section in there for user alias. Mine is
labeled "# User alias specification". Add a line there that reads like
this:
User_Alias XASTIR = username1, username2, username3
where username1, etc, are valid usernames that you wish to be able to do
Xastir installs. For instance you might have:
User_Alias XASTIR = mikey
Next, add a line near the bottom that reads like this:
XASTIR ALL = NOPASSWD: /bin/chmod, /usr/bin/make
Now write out and close the file. At this point the "mikey" user will have
root permissions when he/she runs the commands "/bin/chmod" or
"/usr/bin/make". Make sure the paths to those programs are correct for
your system.
Exit from "su" so that you're a regular (non-root) user again.
To update xastir when the upstream sources have changed, one need only
pull the updated source code and rebuild the code. The process is:
git pull
autoreconf -i
mkdir -p build # actually any new, empty directory will do
cd build
../configure [options needed to help configure find dependencies]
sudo make clean
sudo make install
sudo chmod 4755 /usr/local/bin/xastir
This is actually overly conservative, as it forces a full rebuild
of Xastir after each git update. You can keep your build
directories around and just rerun configure and make in them and
make will only recompile files that have changed.
Windows users: You may need to remove the "sudo" keyword on each line to
have it work properly for you.
A note from Gerry Creager as to another way to set up the sudoers file:
"I now consider it a good idea to add the "gifted" users to the 'wheel'
group and then solely enable wheel in /etc/sudoers; I've seen a recent
article also supporting this."
------------------------------------------------------------------------
Copyright (C) 1999 Frank Giannandrea
Copyright (C) 2000-2026 The Xastir Group
|