LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 02-09-2016, 10:09 AM   #1
tiuz
Member
 
Registered: Mar 2006
Distribution: Slackware 14
Posts: 92

Rep: Reputation: 15
Get output of /var/log/syslog to eg. tty10


Hello,

Via /etc/inittab it was possible to have a line:

c7:12345:respawn:/usr/bin/tail -F /var/log/syslog>/dev/tty10

to get everything that is logged to syslog can be monitored at tty10

Since Debian 8 and systemd there is no more inittab so how would i do this with systemd to get /var/log/syslog to tty10 ?

I know there is a setting in /etc/rsyslog.conf but i would prefer it like described above.

Thx.
 
Old 02-10-2016, 12:55 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by tiuz View Post
Since Debian 8 and systemd there is no more inittab so how would i do this with systemd to get /var/log/syslog to tty10 ?
- create an /etc/systemd/system/logtail.service file with what you want and enable that service,
- do an 'exec' a the end of /etc/rc.d/rc.local and enable the service,
- use an "@reboot" /etc/crontab line.


Quote:
Originally Posted by tiuz View Post
I know there is a setting in /etc/rsyslog.conf but i would prefer it like described above.
Why?
 
2 members found this post helpful.
Old 02-11-2016, 06:08 AM   #3
tiuz
Member
 
Registered: Mar 2006
Distribution: Slackware 14
Posts: 92

Original Poster
Rep: Reputation: 15
Hmm, time to get more familiar with systemd, also i feel itīs a 100 arms kraken :-)

What i donīt get (fully) is why to bother with rc.local and cron wouldnīt one service file which creates tty10 and print the log to it be enough?


Some time ago a serial console was used to print messages to it and with the setting in rsyslogd.conf this didnīt work very reliable, and as a quick "workaround" i used the line in /etc/inittab for that one.
 
Old 02-11-2016, 06:10 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by tiuz View Post
Hmm, time to get more familiar with systemd, also i feel itīs a 100 arms kraken :-)
That's just perception. Think Rene Magritte ;-p Systemd is just a tool.


Quote:
Originally Posted by tiuz View Post
What i donīt get (fully) is why to bother with rc.local and cron wouldnīt one service file which creates tty10 and print the log to it be enough?
LOL no, I gave you three options. As in OR, not AND-ed.


Quote:
Originally Posted by tiuz View Post
with the setting in rsyslogd.conf this didnīt work very reliable
Not reliable in what way?
 
Old 02-12-2016, 07:35 AM   #5
tiuz
Member
 
Registered: Mar 2006
Distribution: Slackware 14
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
That's just perception. Think Rene Magritte ;-p Systemd is just a tool.

Yep, :-) a tool with 100 arms :-) (And around 900 configs and files that belonging to it)...

LOL no, I gave you three options. As in OR, not AND-ed.

Hmm, having on line in /etc/inittab with SYS-V init against having to do three things with systemd to get the same result...

Doesnīt look like an improvement to me...

Iīll play around with that when i have more time to look into it as currently i not only have the time but also donīt want to play around with systemd.

Not reliable in what way?
Having this activated in rsyslogd.conf sometimes just didnīt work, got some error logs (canīt remember what they where since itīs been a few years now) It was a bit like "coin tossing" - most times after reboot it worked some times it didnīt. While the inittab-way always worked.

Well, maybe iīll give it a try again in a fresh install.

Thanks,
tz.
 
Old 02-12-2016, 04:27 PM   #6
tiuz
Member
 
Registered: Mar 2006
Distribution: Slackware 14
Posts: 92

Original Poster
Rep: Reputation: 15
An update on that !

I did a fresh (clean) install of Debian Jessie (Virtual machine with virtualbox) and i tested one of the options.

I choose to add tail -F /var/log/....blablabla to /etc/rc.local

I made sure rc.local will be executed by systemd when booting and guess what, it works.

So for some reason something must have gone wrong during the update from Debian 8 to 9 on the machine where i wanted to use that setting.

Time for some research.

tz
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix logging to both /var/log/mail.log and syslog Zolcsi Linux - Server 2 04-21-2013 03:07 AM
[SOLVED] No /var/log/messages , syslog , kern.log -but cat /var/spool/octopussy/octo_fifo masuch Linux - Newbie 4 06-13-2012 08:05 PM
What those IP's mean in /var/log/syslog ? geropero Linux - Newbie 5 09-04-2009 02:25 PM
No output to /var/log/messages or ~syslog eelriver Slackware 5 07-18-2004 05:13 AM
/var/log/syslog George666 Slackware 4 03-19-2004 07:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration