# freebsd-update; find out if a reboot is required (like updat



## storvi_net (Jun 26, 2013)

Hello guys,

I normally do a `freebsd-update fetch update` to upgrade my system to the latest patch level. By using cron to automate these things (just the check - not the update), I asked myself, if there is any functionality like update-notifier in Ubuntu? Or is there any command I can type in to get the info that I have to restart_?_ I want to put this information into my .profile to be reminded when I log in.

Thanks
Markus


----------



## Wrexxman (Jun 26, 2013)

I have not had a chance to use `freebsd-update fetch update` yet myself.  But, is there something in the output that you could trap and pipe to your .profile?


----------



## storvi_net (Jun 26, 2013)

I missed to check it last time and I do not have any spare VM at the moment 

BR
Markus


----------



## junovitch@ (Jun 26, 2013)

You can just use `freebsd-update cron`.  It will send an email to root if there are updates and it has downloaded them.  As far as the reboot, the security advisories on the FreeBSD web page will say if a reboot is required (kernel updates) or if you can just restart affected services.


----------



## storvi_net (Jun 27, 2013)

So there is no command or status file which is updated? Then I probably can script something by using the information on the FreeBSD page.

Markus


----------



## storvi_net (May 1, 2014)

*Re: freebsd-update; find out if a reboot is required (like u*

Hello again,

today I remebered this thread - and by applying `freebsd-update fetch` the follwing output (shortened) was generated:

```
...
bin/freebsd-version
/boot/kernel/kernel
/boot/kernel/kernel.symbols
/etc/defaults/rc.conf
/usr/lib/libssl.a
/usr/lib/libssl.so.7
/usr/lib/libssl_p.a
/usr/lib32/libssl.a
/usr/lib32/libssl.so.7
/usr/lib32/libssl_p.a
/usr/share/examples/etc/defaults/rc.conf
/usr/share/misc/magic
/usr/share/misc/magic.mgc
/var/db/mergemaster.mtree
...
```

So for this update I have to reboot the server, because of the listed files /boot/kernel/kernel and /boot/kernel/kernel.symbols, correct?
If there would no be any files related to the kernel, a single `freebsd-update install`would be enough, correct?

Thanks
Markus


----------



## dpejesh (May 1, 2014)

*Re: freebsd-update; find out if a reboot is required (like u*

You should be able to compare `uname -r` to `freebsd-version -k` to see if you have a newer kernel installed than the one that's currently running.


```
$ uname -r; freebsd-version -k
10.0-RELEASE-p1
10.0-RELEASE-p2
```


----------



## storvi_net (May 1, 2014)

*Re: freebsd-update; find out if a reboot is required (like u*

This seems to work - I see the given output before my reboot.

But does this "trick" also work if the kernel is updated? Does the uname-Command recognize the "new" Patchlevel automatically? Or is the patchlevel (p1,p2,pn) is just incremented when the kernel changes?

Regards
Markus


----------

