Добро пожаловать, Гость. Пожалуйста авторизуйтесь здесь.
FGHIGate на GaNJa NeTWoRK ST@Ti0N - Просмотр сообщения в эхоконференции RU.UNIX.BSD
Введите FGHI ссылку:


Присутствуют сообщения из эхоконференции RU.UNIX.BSD с датами от 18 Jan 11 22:51:00 до 06 Oct 24 10:23:41, всего сообщений: 10767
Ответить на сообщение К списку сообщений Предыдущее сообщение Следующее сообщение
= Сообщение: 6933 из 10767 ===================================== RU.UNIX.BSD =
От   : Slawa Olhovchenkov               2:5030/500         03 Apr 18 18:17:22
Кому : Ivan Novikov                                        03 Apr 18 18:17:22
Тема : отслеживание dmesg
FGHI : area://RU.UNIX.BSD?msgid=2:5030/500+5ac39b6a
На   : area://RU.UNIX.BSD?msgid=2:5080/31+5ac38b87
= Кодировка сообщения определена как: FIDO ===================================
==============================================================================
Hello Ivan!

03 Apr 18, Ivan Novikov writes to All:

IN> Есть usb вайфайный свисток который, как положено китайскому говну, время от
IN> времени глючит и перестаёт функционировать. При этом в лог валится строчка:
IN> kernel: urtwn0: device timeout
IN> Сам девайс вполне лечится с помощью ifconfig wlan0 down && sleep 5 &&
IN> ifconfig wlan0 up Соответственно вопрос: есть ли какое-нибудь идейно верное
IN> средство для отслеживания определённой строчки в логе и запуска по её
IN> появлении заданной команды?

IN> Понятное дело, что несложно наворотить небольшой скрипт в кронтаб, но у
IN> меня есть предчувствие, что есть готовые более изящные решения.

man syslog.conf

     The action field of each line specifies the action to be taken when the
     selector field selects a message.  There are five forms:

     o   A vertical bar (``|''), followed by a command to pipe the selected
         messages to.  The command is passed to sh(1) for evaluation, so usual
         shell metacharacters or input/output redirection can occur.  (Note
         however that redirecting stdio(3) buffered output from the invoked
         command can cause additional delays, or even lost output data in case
         a logging subprocess exited with a signal.)  The command itself runs
         with stdout and stderr redirected to /dev/null.  Upon receipt of a
         SIGHUP, syslogd(8) will close the pipe to the process.  If the
         process did not exit voluntarily, it will be sent a SIGTERM signal
         after a grace period of up to 60 seconds.

         The command will only be started once data arrives that should be
         piped to it.  If it exited later, it will be restarted as necessary.
         So if it is desired that the subprocess should get exactly one line
         of input only (which can be very resource-consuming if there are a
         lot of messages flowing quickly), this can be achieved by exiting
         after just one line of input.  If necessary, a script wrapper can be
         written to this effect.

         Unless the command is a full pipeline, it is probably useful to start
         the command with exec so that the invoking shell process does not
         wait for the command to complete.  Warning: the process is started
         under the UID invoking syslogd(8), normally the superuser.

... Даже маленькая практика стоит большой теории
--- GoldED+/BSD 1.1.5-b20110223-b20110223
* Origin:  (2:5030/500)

К главной странице гейта
Powered by NoSFeRaTU`s FGHIGate
Открытие страницы: 0.107170 секунды