0

Hi I have turned on watchdog and configurate them at my raspberry. I tested at my raspberry with fork-bomb and watchdog work - fork-bomb

( I wrote this command to console )
:(){ :|:& };:

freeze my computer and watchdog restart device. But after restart my raspberry pi zero want to write password... Anybody has idea why?

EDIT: I should write that before - if in normal situation I do sudo reboot or restart with, i don't need write login

EDIT2: my watchdog service : /lib/systemd/system/watchdog.service ( i haven't changed it )

[Unit]
Description=watchdog daemon
Conflicts=wd_keepalive.service
After=multi-user.target
OnFailure=wd_keepalive.service

[Service]
Type=forking
EnvironmentFile=/etc/default/watchdog
ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module'
ExecStart=/bin/sh -c '[ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options'
ExecStopPost=/bin/sh -c '[ $run_wd_keepalive != 1 ] || false'

[Install]
WantedBy=default.target
4
  • Pretty sure that will amount to an unclean shutdown; the forkbomb would have prevented anything else -- I've never used the watchdog, and don't know whether it even tries to do such, but if it does it would fail. While the system wouldn't have been doing much I/O to the SD card at the time, reducing the chance of filesystem corruption, it could still happen.
    – goldilocks
    Jun 11 at 14:55
  • If you boot normally, do you get asked for a password? Jun 12 at 1:54
  • @JaromandaX - if i boote normally (for example sudo reboot) after restart i don't need write a password Jun 12 at 4:38
  • @goldilocks - hmm okay - so if it could be problem with forkbomk what i should use to test of my watchdog work? Jun 12 at 4:41
0

It is not clear to me what you want to achieve. Do you want that your raspberry reboots without a password prompt / autologin enabled? This can be done in raspi-config 1 System Options--> S5 Boot / Auto Login then select Console Autologin or Desktop Autologin.

3
  • Exacly - autologin/without a password prompt is my purpose. In normal situation after restart with gui or sudo reboot Normally computer is run and I will be autologged - but when i force raspberry to use watchdog - after restart i need write a pass Jun 12 at 4:44
  • Can you please post the code of your watchdog?
    – Hannes
    Jun 13 at 10:57
  • do you mean a watchdog.conf? Jun 14 at 9:54
0

Ok i think i found answer at this page (and this worked for fork-bomb case)

https://medium.com/@arslion/enabling-watchdog-on-raspberry-pi-b7e574dcba6b

I changed in last line from

WantedBy=default.target

to

WantedBy=multi-user.target

and ofcourse - i did sudo systemctl daemon-reload in CLI to refresh implement this change to service

Thanks everybody for comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.