| Author |
Message |
|
|
Post subject:
Posted: Jul 18, 2008 - 04:32 PM
|
|

Joined: Jan 07, 2008
Posts: 290
Status: Offline
|
|
| new version 0.2 with trapping, locking and session logging |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 18, 2008 - 04:35 PM
|
|

Joined: Jan 07, 2008
Posts: 290
Status: Offline
|
|
| @michaaa62: ceni can be run within X. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 18, 2008 - 06:03 PM
|
|
Joined: Dec 21, 2006
Posts: 294
Location: Slough, England
Status: Offline
|
|
charon -l smxi
shuts the kde session then immediately reopens it
Code:
INIT: Switching to runlevel: 3
* Stopping K Display Manager: kdm * Stopping K Display Manager: kdm
[ ok ]
[ ok ]You are now in runlevel 3.
/usr/local/bin/charon: line 83: -l: command not found
INIT: Switching to runlevel: 5
* Starting K Display Manager: kdm
[ ok ]
Will be great to get logging working. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 18, 2008 - 07:43 PM
|
|

Joined: Jan 07, 2008
Posts: 290
Status: Offline
|
|
| @dzz: did you get the new version? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 18, 2008 - 07:52 PM
|
|
Joined: Dec 21, 2006
Posts: 294
Location: Slough, England
Status: Offline
|
|
Ignore that post!
The old version was still in /usr/local/bin it's just me again, probably extracted it to the wrong place
It's working perfectly now (new version) and the log is where it should be. Sorry for the false alarm! |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 23, 2008 - 10:22 AM
|
|
Joined: Dec 21, 2006
Posts: 294
Location: Slough, England
Status: Offline
|
|
I'm really enjoying myself trying out this script! Now working flawlessly (DU gets done here most days)
The log files are all there, you can even read the current in another tty as it's happening (mcedit)
As much as I like h2's terminal colours, their characters make a text log hard to read. My understanding of sed is pretty minimal but I cobbled this together:
Code:
sed 's/\x1b\[[0-9]\{1,2\}\(;[0-9]\{1,2\}\)\{0,2\}m//g' /var/log/charon/* > charon-log
and it wrote a text file to /home/me with those characters removed.
Maybe in the future, something along those lines to write the log directly? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 23, 2008 - 06:10 PM
|
|
Joined: Nov 28, 2006
Posts: 4277
Status: Offline
|
|
wow, I was banging my head against the wall trying to figure out how to remove color codes from output myself, lol...
By the way, if I didn't mention it, I added new option, because modestUser mentioned it, -j, which turns off smxi and related script colors.
Also, smxi also does full logging by default now, always. Those logs are quite substantial, found in: /var/log/smxi.log (with rotate running for > 200kB, to log1, log2), /var/log/sgfxi/sgfxi.log, with rotate, and /var/log/svmi.log
<added this to s**i logging, great stuff. |
_________________ sidux Maintenance script: dist-upgrade, kernel install, general utilities: smxi
Backup script [using rdiff-backup]: rd-h2.sh
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 23, 2008 - 07:05 PM
|
|
Joined: Dec 21, 2006
Posts: 294
Location: Slough, England
Status: Offline
|
|
Yes the -j option is mentioned elsewhere but why would we do that, the colours in the terminal look so good! Also actually help readability.
Good that logrotate is considered. Log files can get very large and forgotten (kernel logs have crashed my system in the past) |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 23, 2008 - 08:50 PM
|
|

Joined: Jan 07, 2008
Posts: 290
Status: Offline
|
|
The problem with the 'sed' command is that the escape sequence is not always escaped. They could be in quotes, e.g. One would need precise syntactical tracking to know if a certain sequence would indeed be displayed as color. This is why i did not go for sed but suggest using either the -j option or a pager that supports colors. 'most' (sidux default) can do this. Just do most /var/log/charon/foo.
btw, how do you handle rebooting? i found it very annoying that charon does init 5 if you are done and i thought i should change this. Probabaly CTRL-C should not go to runlevel 5 but give you a shell. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Jul 24, 2008 - 12:11 AM
|
|
Joined: Dec 21, 2006
Posts: 294
Location: Slough, England
Status: Offline
|
|
Using charon to do smxi, normally the only reason to reboot is after a new kernel: then that option is within smxi anyway? Other console jobs (including shutdown -r now) can be called from a second terminal, before smxi exit (after script tasks are finished). For example I do apt-move update && apt-get clean at the console after DU, while kde is not in my face. Obviously charon's root terminal must be closed clean afterwards, just as one does init 5 && exit when not using smxi; a user doing multiple terminals should know that.
Would it not defeat the point of the script if it were a one-way ticket to init 3? It's pretty damn good as it is bar a little minor tweaking.
I don't know sed well enough to comment on it's finer points at all; I'm sure others here do. I just tried that as an experiment for what seems a good idea for the log, knowing sed to be the stream editing tool. I like to see those colours in the terminal. |
|
|
| |
|
|
|
 |
|
|