zyga / snapd-gentoo

Gentoo packaging for snapd
2 stars 0 forks source link

snapd doesn't restart on package upgrade #2

Open zyga opened 8 years ago

zyga commented 8 years ago

During the upgrade from 2.0.8 to 2.0.8.1 I've noticed that snapd didn't get restarted. I think this should be done automatically.

StefanCristian commented 8 years ago

Use pkg_ functions to define these kinds of operations like restarting and so forth. Generally, ebuilds defined without pkg_postinst, pkg_postrm, etc. do basically just compile and install from the sandbox'ed instance of creating the package to the actual host.

Instead, while defining pkg_postinst, it will do additional actions as implied after compilation/installation sequence. Folks from Gentoo preferred to separate these functions for security and philosophical reasons.

zyga commented 8 years ago

Hey, thanks for the feedback! I'm not an experienced gentoo packager. Would you be so kind to point me to an example in portage that I can use as reference?

timjp87 commented 8 years ago

@zyga Looks like we should add that to the post_upgrade() routine in the snapd.install file on Arch, too.

zyga commented 8 years ago

Yes, that's a good point, now reported as listed above

StefanCristian commented 8 years ago

@zyga no problem. Well, you can add in the pkg_postinst() just the necessary post-package-installation actions, like: systemctl stop ${PN}.refresh.timer systemctl stop ${PN}.socket systemctl start ${PN}.socket systemctl start ${PN}.refresh.timer

Whereas PN represents the name of the ebuild / package ( before/without the version ) It should do the trick

zyga commented 8 years ago

Ah, nice, let me try that @StefanCristian