You are not logged in.

#1 2016-07-15 20:07:25

A Future Pilot
Member
Registered: 2008-10-17
Posts: 120

How to create a "Please Restart" notification?

Hey everyone!

So I have Arch Linux installed on my mother's computer and I set it up to update every 8 hours using pacaur following the directions here.

Now what I'd like to do is have some way of pushing a "You need to restart to finish installing updates" notification any time the kernel is updated (which is primarily the main time the computer needs to reboot). My mom hardly ever restarts, so I want to have a notification to remind her.

The other option would be to just have this notification pop up every week so that she'll restart, just to keep things running smoothly. It'd also be nice if, after the notification was dismissed, it would re-occur every ten minutes or so until the system was actually restarted (so that she won't just dismiss it and forget).

I know that auto-updates aren't recommended, but it's better than no updates, and I can SSH, or Teamviewer in to fix anything if an update breaks her system.

Any suggestions on how to do this?

Thanks!

Offline

#2 2016-07-15 20:17:51

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: How to create a "Please Restart" notification?

A Future Pilot wrote:

I know that auto-updates aren't recommended, but it's better than no updates, and I can SSH, or Teamviewer in to fix anything if an update breaks her system.

You're darned tootin' auto-updates aren't recommended! wink

If you have SSH access, why not just update it yourself?

If that's not an option, then I can't say Arch Linux was the best choice to install...

Last edited by drcouzelis (2016-07-15 20:18:14)

Offline

#3 2016-07-15 20:30:10

A Future Pilot
Member
Registered: 2008-10-17
Posts: 120

Re: How to create a "Please Restart" notification?

drcouzelis wrote:

You're darned tootin' auto-updates aren't recommended! wink

If you have SSH access, why not just update it yourself?

If that's not an option, then I can't say Arch Linux was the best choice to install...

Lol yeah...

I chose Arch Linux cause it's my favorite distro and I was sick of re-installing Linux for her every few months. The only rolling releases available are Debian, Manjaro, and Arch. I'm not a fan of Debian and I've never used Manjaro so I chose Arch.

And why not update myself? Honestly...cause I'm lazy and only want to have to deal with it if something goes wrong tongue

Offline

#4 2016-07-15 21:23:17

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: How to create a "Please Restart" notification?

I built ma' maa an Archbox, too. She's super happy. I find 8 hours a bit stiff. I manually upgrade the box via SSH once a week or when she complains she's not seeing an emoticon in her chat software. I also wrote her a little script that updates said chat software from the AUR. Make a fixed patch day. Once a week you ssh+pacman+my_fancy_aur_helper, reboot the machine and be done with it.

Offline

#5 2016-07-15 21:39:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: How to create a "Please Restart" notification?

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2016-07-15 23:07:54

Rethil
Member
Registered: 2014-08-21
Posts: 83

Re: How to create a "Please Restart" notification?

A Future Pilot wrote:
drcouzelis wrote:

You're darned tootin' auto-updates aren't recommended! wink

If you have SSH access, why not just update it yourself?

If that's not an option, then I can't say Arch Linux was the best choice to install...

Lol yeah...

I chose Arch Linux cause it's my favorite distro and I was sick of re-installing Linux for her every few months. The only rolling releases available are Debian, Manjaro, and Arch. I'm not a fan of Debian and I've never used Manjaro so I chose Arch.

And why not update myself? Honestly...cause I'm lazy and only want to have to deal with it if something goes wrong tongue

There is also OpenSUSE Tumbleweed. It's more standard-user-proof than Arch. But anyway, I would recommend you to stop being lazy if you want painless experience with nix stuff for your mother.

If I was you I would write small pyqt window that prints the message if pacman exits. If you're using pacaur I presume you're using packages from AUR, yet another thing that I won't recommend to update automatically.

Offline

#7 2016-07-16 00:32:25

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: How to create a "Please Restart" notification?

To your original question:

You could create pacman hook, triggered by certain package upgrades, that enables systemd timer, that sends notificatication with notify-send to your mom's desktop reminding her to reboot.

I don't know whether the timer will stop when you reboot, so you may also have to figure out some way to disable it on boot-up.

Offline

#8 2016-07-16 00:56:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: How to create a "Please Restart" notification?

A Future Pilot wrote:

and I can SSH, or Teamviewer in to fix anything if an update breaks her system.

Not if this horrible idea of unattended updates and unmerged pacnews prevents her system from booting, or from running the sshd, or ... or ...

A Future Pilot wrote:

I chose Arch Linux cause it's my favorite distro

You "give" something to mother thinking primarily about what is your favorite rather than what will be good for her?  Thank you for validating my choice to never have children.

A Future Pilot wrote:

...cause I'm lazy and only want to have to deal with it if something goes wrong tongue

Has anyone told your mother how lucky she is to have you?  If so, they lied.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2016-07-16 01:10:45

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: How to create a "Please Restart" notification?

A Future Pilot wrote:

Honestly...cause I'm lazy and only want to have to deal with it if something goes wrong tongue

Automated updates is a pretty good way to ensure that something goes wrong. It's sort of like automating a sunroof to open every afternoon because you think every day will be sunny and dry.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#10 2016-07-16 07:46:39

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: How to create a "Please Restart" notification?

Trilby wrote:
A Future Pilot wrote:

I chose Arch Linux cause it's my favorite distro

You "give" something to mother thinking primarily about what is your favorite rather than what will be good for her?  Thank you for validating my choice to never have children.

Don't you think you knee jerk reaction goes a little too far? I also have a mother with an Arch box, who didn't have a choice in distros, because I am the one to fix everything going wrong with it anyway. I picked Arch for her laptop, because it's by far the most easy distro to fix (for me) if anything breaks, because I have been breaking and fixing it for half a decade. I also have tried to automate the update for her, because it's counter productive to her wish to become a grandmother one day, if I'm in the middle of some reproductive ritual and have to answer a phone call about some missing emoticons in a chat client. It didn't work out in the end, because I cannot control what she installs by herself.

She's also a figurative wild card, because on one day she forgets what MPD client she's supposed to use and downloads the windows version (!) of another and then calls me, because wine doesn't run it, but on another day she navigates the Arch wiki and changes her 20-intel.conf from sna to uxa, because she thought she saw some tearing. Now, given a randomly supra-competent user with an entry in the sudoers (because you want to shag undisturbed from time to time), tell me, please, what would you rather have to fix: An Arch system, the one you know in your sleep, or some Debian based behemoth with commands like dpgk-reconfigure for your mother to abuse once the hidden identity as a part time villain kicks in?

The worst part: All of this happened, because OP was too lazy to google "linux shell script gui".

Offline

#11 2016-07-16 15:02:22

A Future Pilot
Member
Registered: 2008-10-17
Posts: 120

Re: How to create a "Please Restart" notification?

Awebb wrote:

The worst part: All of this happened, because OP was too lazy to google "linux shell script gui".

Not too lazy, just not honestly not sure why I would google that. I'm not looking to make a graphical dialog, I'm looking to make push notifications that repeat every ten minutes and are triggered either by a kernel upgrade, or just automatically happen every week.

Thank you for defending my choice of Arch though smile

ooo wrote:

You could create pacman hook, triggered by certain package upgrades, that enables systemd timer, that sends notificatication with notify-send to your mom's desktop reminding her to reboot.
I don't know whether the timer will stop when you reboot, so you may also have to figure out some way to disable it on boot-up.

Thanks, I'll look into this!


[rant]
I have been using Arch for almost 10 years now off and on. It's been almost 5 years since I can remember an update truly breaking the system (actually not able to boot). Otherwise, there's only been a handful of times when an update really needed much manual intervention. For over a year I've had an Arch box that I update every day (or at least a couple times a week), and in all that time NOTHING has broken. I've never once had to manually fix anything caused by an update.

Arch pushes this idea that because it's bleeding-edge and rolling-release it's inherently unstable. I disagree. Now, I wouldn't install it on a pacemaker, but for average-joe computer work, it's plenty stable! Yes, I understand auto-updates will occasionally fail, but it's not like the computer's gonna explode. This kind of goes back to my least favorite part about Arch: "The Arch Way", hands down.
[/rant]

Offline

#12 2016-07-16 16:45:25

Rethil
Member
Registered: 2014-08-21
Posts: 83

Re: How to create a "Please Restart" notification?

A Future Pilot wrote:

[rant]
I have been using Arch for almost 10 years now off and on. It's been almost 5 years since I can remember an update truly breaking the system (actually not able to boot). Otherwise, there's only been a handful of times when an update really needed much manual intervention. For over a year I've had an Arch box that I update every day (or at least a couple times a week), and in all that time NOTHING has broken. I've never once had to manually fix anything caused by an update.

Arch pushes this idea that because it's bleeding-edge and rolling-release it's inherently unstable. I disagree. Now, I wouldn't install it on a pacemaker, but for average-joe computer work, it's plenty stable! Yes, I understand auto-updates will occasionally fail, but it's not like the computer's gonna explode. This kind of goes back to my least favorite part about Arch: "The Arch Way", hands down.
[/rant]

All depends on your setup. I'm using btrfs, xfs, custom kernel with ck and apparmor, lvm cache, nvidia-dkms that forces me to rebuild initrd by hand every time I update kernel, cuz pacman does it earlier than dkms autoinstall, prelink, zswap, mariadb, some dev tools and other things that could break. I need to tweak something by hand or fix frequently, ah, and merge my custom configs with pacnew ones. From my and friends experience I think it's best to be cautious with every setup, anything can break, even when it's not that volatile sometimes, it does not mean it's good practice to leave your OS by itself when it's rolling release model.

Offline

#13 2016-07-16 19:58:10

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: How to create a "Please Restart" notification?

Okay, let's do this. Look up Zenity.

Offline

#14 2016-07-16 20:30:06

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: How to create a "Please Restart" notification?

If you want something less intrusive (reminders without a confirmation dialogue that interrupts the user), use desktop notifications.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#15 2016-07-17 00:44:26

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: How to create a "Please Restart" notification?

pacman hooks + desktop notifications


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#16 2016-07-17 09:09:43

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: How to create a "Please Restart" notification?

fsckd wrote:

pacman hooks + desktop notifications

Good idea! I'd even go as far as limiting the reboot requests to the packages actually requiring a reboot.

I think it's time to do away with the myth, that Arch updates cannot be automated. We just have to be clear about not supporting the mess it leaves in the rare case it actually breaks.

Offline

#17 2016-07-17 11:40:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: How to create a "Please Restart" notification?

No one has ever claimed that arch updates cannot be automated.  I wish they couldn't be, it'd avoid problems.  But clearly updates can be automated.  It's just a horrible idea to do so which follows directly from the second half of your statement.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#18 2016-07-17 12:11:37

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: How to create a "Please Restart" notification?

I understand how you feel, Trilby. It's often the ones who try to automate are the ones who shouldn't.

Offline

#19 2016-07-18 12:57:50

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: How to create a "Please Restart" notification?

I don't know, it kind of reminds me of the "running as root" debate. Someone will mention always running as root, I'll wag my finger at them, and they'll get on with their life, always logging in as root, and never encountering an issue. *shrug* whaddyagonnado smile

Offline

Board footer

Powered by FluxBB