You are not logged in.
What is a safe way to edit a system configuration file? I mean I did this twice: I edited rc.conf, rebooted and the system failed to boot. Then I had to edit out the typos with a LiveCD.
Is there like a visudo (that edits /etc/sudoers) for rc.conf, xorg.conf, fstab and so on?
Thanks!
Offline
You can only edit system config files as root. I don't know what you want exactly, because there isn't a safer way than to limit access to those files to root-only. Using sudo would just be the same.
If you're worried about making a certain configuration, just ask on the forum first.
Last edited by dyscoria (2008-03-17 16:49:27)
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
What you edit it in doesn't matter. If it won't boot because of the file, it won't boot because of the file. You really have no choice then but to boot to a liveCD to change it, whether you edit it in vim, nano, emacs, kate, or anything else. visudo has nothing to do with system configuration files, I don't really understand your question on that.
Offline
No I am of course editing those files with sudo. But the problem is, gedit won't check the file for possible errors, thus if you too oversee it and try to reboot using those system files, you will fail.
visudo checks you while you edit, so if you make an error it will warn you in the end.
I was asking if there was a similar tool for the rest of the configuration files.
Sorry for not being clear.
Offline
visudo is merely using the text editor vi, which has that extra functionality. You can also use vim.
pacman -Rscn emacs
pacman -Sy vim
Then you can do:
su
vim /etc/rc.conf
*the emacs bit is a joke *
Last edited by dyscoria (2008-03-17 17:00:21)
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
No I am of course editing those files with sudo. But the problem is, gedit won't check the file for possible errors, thus if you too oversee it and try to reboot using those system files, you will fail.
visudo checks you while you edit, so if you make an error it will warn you in the end.
I was asking if there was a similar tool for the rest of the configuration files.
Sorry for not being clear.
Oh -- a kind of a babysitter, you mean?
j/k, i screw up config files all the time.
No, as far as I know there is nothing like that for most files. some do have functionality like that, like I think lilo warns you when you write to lilo.conf and the file has errors. and you can run something like testparm for the smb.conf file, and I think there something similar to check apache config files, etc. but for the standard system config files or arch-specific files like rc.conf, fstab, etc. I don't think there is anything. you just have to be sure not to make any mistakes!
Offline
visudo is merely using the text editor vi, which has that extra functionality. You can also use vim.
pacman -Rscn emacs pacman -Sy vim
Then you can do:
su vim /etc/rc.conf
*the emacs bit is a joke *
does anyone actually use emacs? I've never used it a day in my life, and don't know anyone who actually does use it.
/ducks
Offline
Use an editor with syntax highlighting, that reveals errors pretty often.
Offline
rc.conf is technically a shell script, so if you source it after you edit it, you might pick up some syntax errors...
Dusty
Offline
I started off using nano. Now I'm getting comfortable with vim. Next, I'll try emacs...
baby steps....baby steps...
Offline
Use an editor with syntax highlighting, that reveals errors pretty often.
That's a good idea.
rc.conf is technically a shell script, so if you source it after you edit it, you might pick up some syntax errors...
That's also a very nice idea
Offline
does anyone actually use emacs? I've never used it a day in my life, and don't know anyone who actually does use it.
/ducks
I use emacs. It's a pain in the a** to set up (google is my friend). But once you've got it set up, it's great.
No need to duck.
Offline
slackhack wrote:does anyone actually use emacs? I've never used it a day in my life, and don't know anyone who actually does use it.
/ducks
I use emacs. It's a pain in the a** to set up (google is my friend). But once you've got it set up, it's great.
No need to duck.
emerge-files command in emacs actually makes for pretty easy-mode pacnew handling.
Offline
I've been using vimdiff for that. Emacs sounds like it has a pretty steep learning curve. It's also a very large program. 31MB for a command line editor!
Offline
I've been using vimdiff for that. Emacs sounds like it has a pretty steep learning curve. It's also a very large program. 31MB for a command line editor!
That's the thing, it's not a command line editor, it's a full graphical OS.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
emacs kungfu.divx
It's just missing a codec!
I need real, proper pen and paper for this.
Offline
That's the thing, it's not a command line editor, it's a full graphical OS.
Agreed! Emacs is one step too far... Soon, it'll combine the functions of Firefox, ePDFview, Mplayer, GIMP and MPD all into one. You'll never need another program again!
It'll also do your weekly shopping as a cronjob
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
I liked Emacs a lot back when I liked Emacs. Now I like Vim a lot
The size of Emacs is hardly relevant anymore, is it? We have huge RAM and disk capacity now. It's also not such a bad thing to put up Emacs and just stay there for your coding, mail, news, etc. Think of it as a suite ... and smaller than OpenOffice ...
But if you don't code, I'd say Emacs isn't worth the bother.
noobus in perpetuus
Offline
But if you don't code, I'd say Emacs isn't worth the bother.
In fact, if you've heard of vim, emacs isn't worth the bother.
i've taken this joke too far, right?
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
This isn't a text editor holy war threads. We don't have those at Arch. Vim and emacs are incomparable, they're very very different tools that happen to be used for similar things. They tend to be oriented toward two different sorts of people.
For the most part, it seems like the sort of people that prefer Arch are the sort of people that prefer Vim, but this isn't a hard and fast rule. Some of us prefer to write our own editors for example. :-D
Dusty
Offline