Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.os.linux.ubuntu > #197414
| From | Bit Twister <BitTwister@mouse-potato.com> |
|---|---|
| Newsgroups | alt.os.linux.ubuntu |
| Subject | Re: nautilus not working/wireless not responding either |
| Date | 2017-10-05 05:03 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrnotbf8r.b7l.BitTwister@wb.home.test> (permalink) |
| References | <f2qfqqF74g9U1@mid.individual.net> <oq922b$73i$1@dont-email.me> <f3lkd8FidpgU1@mid.individual.net> |
On Wed, 4 Oct 2017 19:40:38 -0700, fred flintstone wrote:
>
> How do I rewrite this script so that it a)would run when there is an
> outage,
You start by learning a little bit about systemd, then much more via
man systemd.unit
Once you figure out which service unit file you want to add the
OnFailure=/where/ever/your_script_fn_here line to a drop-in file.
You create the drop-in directory /etc/systemd/system/WHICH_SERVICE.service.d/
and you create a .conf drop-in file with something like
[Unit]
OnFailure=/where/ever/commands.sh
Next time WHICH_SERVICE is started your drop-in file's additional Unit
directive(s) will be added to the service.
I can highly recommend using a unique naming convention so you can
locate those kinds of files. As an example, I have
$ locate xx__ | wc -l
38
customization files.
As an example I want the mysqld service to timeout in 150 seconds
instead of the default time out so my drop-in file
/etc/systemd/system/mysqld.service.d/xx__local.conf
has
[Service]
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=150
> creating a log and b) looks like it wasn't written in crayon?
I suggest you might want to spend some time in "man journalctl"
and pay attention to the --since= paragraph. Then "man date" might
suggest how to get the "now minus a minute date/time" to use on
journalctl command line to get a copy of what went on a minute before
commands.sh ran.
example: journalctl --since="$date_time" >> 1.log
removes all your /var/log/syslog code
> $ cat commands.sh
What, no
#!/bin/bash
If the script is to run from a systemd invocation, I can also recommend
adding something like
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
> egrep -i "error|fail" /var/log/syslog >1.log
> tail -f /var/log/syslog >>1.log
> ^C
> sudo service network-manager restart
> tail -f /var/log/syslog >>1.log
Pretty sure your "tail -f" will never return to run the next command
in your script.
Just for fun, click up a terminal and paste the following:
sudo -i
journalctl | grep -iE "error|fail"
When through playing with journal commands run
exit
You may want to bookmark this url
https://encrypted.google.com/advanced_search
and put something like the following in the first box
systemd notification network fail
Back to alt.os.linux.ubuntu | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-09-24 12:36 -0700
Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-09-24 15:46 -0400
Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-09-29 14:26 -0700
Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-04 19:40 -0700
Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-05 05:03 +0000
Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-07 15:49 -0700
Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-07 23:24 +0000
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-10 23:22 +0000
Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-10 20:32 -0700
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-11 04:52 +0000
Re: systemd was Re: nautilus not working/wireless not responding either Melzzzzz <Melzzzzz@zzzzz.com> - 2017-10-11 05:00 +0000
Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-12 16:09 -0700
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-13 03:06 +0000
Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 00:33 -0400
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-13 05:00 +0000
Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 09:31 -0400
Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 09:32 -0400
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-13 14:19 +0000
Re: systemd was Re: nautilus not working/wireless not responding either Marek Novotny <marek.novotny@marspolar.com> - 2017-10-13 09:56 -0500
Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-22 14:35 -0700
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-22 23:57 +0000
Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-25 12:03 -0700
Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-26 12:46 -0400
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-26 23:54 +0000
Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-31 17:28 -0700
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-11-01 01:36 +0000
Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-11-06 12:35 -0800
[OT] Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-27 00:23 +0000
Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-25 16:13 -0700
Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 11:42 -0400
Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 11:45 -0400
Re: systemd was Re: nautilus not working/wireless not responding either fred flintstone <fred@server.invalid> - 2017-10-13 17:03 -0700
Re: systemd was Re: nautilus not working/wireless not responding either "Jonathan N. Little" <lws4art@gmail.com> - 2017-10-13 20:25 -0400
Re: systemd was Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-14 01:45 +0000
Re: systemd was Re: nautilus not working/wireless not responding either Mike Easter <MikeE@ster.invalid> - 2017-10-10 16:34 -0700
Re: systemd was Re: nautilus not working/wireless not responding either Mike Easter <MikeE@ster.invalid> - 2017-10-10 16:41 -0700
Re: nautilus not working/wireless not responding either Mike Easter <MikeE@ster.invalid> - 2017-10-11 10:28 -0700
[OT] Re: nautilus not working/wireless not responding either Bit Twister <BitTwister@mouse-potato.com> - 2017-10-11 17:50 +0000
csiph-web