# kernel panic on reboot/shutdown

## Adel Ahmed

every now and then(around once every 5 reboots/power offs), I get a kernel panic, this has been going on for quite a while now

I'm not exactly sure why this happens

here's a screenshot of the message:

http://en.zimagez.com/zimage/dsc0002edc15a10c98614d1895885f022d51ff0.php

thanks

----------

## Ant P.

The crash is inside nvidia proprietary code.

----------

## Adel Ahmed

did you figure this out from the call trace? just in case I try to debug/figure out a kernel oops

I've modrpobe -r before I shutdown and there have been no problems, so it's indeed the nvidia module, should I file a bug report?

----------

## Adel Ahmed

well I'm trying to create a startup script that would modprobe -r nvidia on shutdown

It works 80% of the time

Once It's working Ill post the script

----------

## cboldt

Why not just put a command line (modprobe -r nvidia) into /etc/local.d/local.stop  ?

----------

## Adel Ahmed

that script is not being read, I'm using systemd if that's relevant

----------

## Adel Ahmed

I've been testing thescript for quite a while now:

/etc/systemd/system/startup.service:

[Unit]

Description=startup-scripts

[Service]

Type=oneshot

ExecStart=/home/adel/scripts/startup systemd

ExecStop=/home/adel/scripts/startup systemd-stop

[Install]

WantedBy=graphical.target

and /home/adel/scripts/startup:

systemd-stop)

/sbin/modprobe -r nvidia

I'm using this script to start and stop other apps as well

----------

