naphelge
Posts: 7
Joined: Sun Dec 24, 2017 11:40 pm

network services seem unavail after shutdown -r/h

Mon Dec 25, 2017 12:06 am

I just got started playing with raspi 3s. I have 2 of them, 1 I want to set up as a media server and the second a home automation server. I am having a weird problem with both that makes me think the problem is user error rather than anything hardware related.

I can only connect headless as I have no access at home or work to a monitor and external keyboard. After initially connecting without issue to either unit, having created the required ssh file in the /boot/ partition, after a shutdown -r or -h the raspi fails to get assigned an IP addy. I know without a doubt the network cables as well as the ETH ports on the switch are good since I can use them for other NEs without hiccup and they are the ones used to initially connect with the raspi's.

It almost seems as though the network services get turned off after the initial ssh session, when a shutdown command is issued to reboot or shut down. The raspi doesn't show up in the router's NE list with an issued ip addy. So of course I can't ping the raspi at the last ip addy it was assigned.

So I have resorted three ties now to re-flashing the offending SD cards with Raspbian, adding the necessary ssh file, and then all is good once more until a shutdown command is again issued.

So I now assume the problem here is operator error. Is there possibly something glaringly obvious that I could be missing to configure with network services on a newly initialized raspi? If not what else could be the problem? The exact same issue is happening with both units I have to play with here. Any help or suggs offered would sure be appreciated.

wh7qq
Posts: 960
Joined: Thu Oct 09, 2014 2:50 am

Re: network services seem unavail after shutdown -r/h

Mon Dec 25, 2017 11:42 pm

The "shutdown" command does exactly what it says...shuts down the Pi...period. If you want to get out of your ssh session without the shutdown and loss of connectivity, try "exit" which will put you back on the machine that originally called the ssh session. "Shutdown" turns off all the functions of the RPi and even requires a power cycle to reboot. With "exit" you can start a new ssh session from any machine connected to your LAN at a later time. "Shutdown", "poweroff" and "halt" are just clean ways of turning off the RPi without the danger of messing up the uSD card. Those commands make sure that all file processes are stopped so that file corruption does not happen. They don't pull the plug, but you do have to do some things yourself ;) .
Sent by WH7QQ from an RPi3/Raspbian/pixel desktop.

naphelge
Posts: 7
Joined: Sun Dec 24, 2017 11:40 pm

Re: network services seem unavail after shutdown -r/h

Wed Jan 03, 2018 7:10 pm

The "shutdown" command does exactly what it says...shuts down the Pi...period
Yes, I understand what the command "shutdown" does. I have been using it for the past 20 or so years since first choosing linux as my preferred choice OS.

My problem, and it is still a problem is that when I perform a simple

Code: Select all

shutdown -r now
or

Code: Select all

shutdown - h now
to restart or halt, when the raspi comes back up it does not appear to do so with network services, failing to re-join the network.

I verify the raspi has not simply re-joined the network with a different IP addy running

Code: Select all

nmap -sP 192.168.1.0/24
.

I know my cables are good (verified working amongst multiple NEs).

I know the dhcp server config'd on my openwrt router is fine as other devs that leave and re-join the network do so without hiccup.

I just had to

Code: Select all

shutdown -r now
my raspi today, troubleshooting a minidlna issue. I see that the raspi is powered on fine and even the ETH port leds illuminate and even seem to perhaps be doing some handshaking as the green led intermittently blinks, suggesting network activity, but it's just not there, on the LAN.

Unfortunately I do not simply have a monitor/keyboard kicking around so that I can plug them into the PI and investigate, so before I am faced with re-flashing yet again, although re-flashing for this issue is already old, I am wondering if someone else might have some insight or suggestions. I was hoping like having to add the "empty" "ssh" file to the /boot/ prior to first boot that there might be some additional PI specific things I overlooked getting this up and running. By the by, I have tried simply putting another "empty" file named "ssh" in the flash's /boot/ drive and that did nothing, as expected, since it is not simply a matter of logging into the NE but that it does not rejoin the LAN.

Running raspbian by the way. I think I might try another distro, hoping there is an openbox flavor if so, if I do end up having to re-flash, but I would really prefer not to have to.

wh7qq
Posts: 960
Joined: Thu Oct 09, 2014 2:50 am

Re: network services seem unavail after shutdown -r/h

Thu Jan 04, 2018 1:03 am

I guess I really don't understand your dilemma. I routinely do "reboot" or "halt" on my headless RPi Zero/Raspbian Stretch and have no problem restoring the wifi networking. It automatically exits the ssh session (if running) back to the originating console but if I reboot the remote, when I ssh back in, it comes back (with a delay for the boot process to complete).You might try either of the above commands and see how that works for you. Maybe there is some peculiarity in the shutdown command that causes it. It should be pretty interchangeable with the "poweroff" or "halt" command but I have not examined the code.

If for any reason, my network goes down, I have to reboot the RPi so I have a dumb little cron script that checks connectivity every 10 min and reboots if the network is not there. Supposedly there is a way to reconnect without rebooting but I have not had good luck with it. Not sure why, but I have only 16 years experience with Linux...maybe when I get to 20...:) learning all the time. In any case, it reboots automatically and the connection is restored.
Sent by WH7QQ from an RPi3/Raspbian/pixel desktop.

mattmiller
Posts: 1834
Joined: Thu Feb 05, 2015 11:25 pm

Re: network services seem unavail after shutdown -r/h

Thu Jan 04, 2018 11:06 am

Just as an experiment - get your Pi running normally and then just turn the power off - wait 10 secs as they say - turn it back on

Does it reconnect to the network by itself?

pcmanbob
Posts: 3889
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: network services seem unavail after shutdown -r/h

Thu Jan 04, 2018 1:44 pm

mattmiller wrote:
Thu Jan 04, 2018 11:06 am
Just as an experiment - get your Pi running normally and then just turn the power off - wait 10 secs as they say - turn it back on

Does it reconnect to the network by itself?
Turning the power of on a pi that is running without executing a shutdown command is a good way to corrupt your SD card.
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

mattmiller
Posts: 1834
Joined: Thu Feb 05, 2015 11:25 pm

Re: network services seem unavail after shutdown -r/h

Thu Jan 04, 2018 4:21 pm

Turning the power of on a pi that is running without executing a shutdown command is a good way to corrupt your SD card.
Nah - you do stand a chance but you need take a hammer to it to really fess it up [/EndTongueInCheek] :)

naphelge
Posts: 7
Joined: Sun Dec 24, 2017 11:40 pm

Re: network services seem unavail after shutdown -r/h

Fri Jan 05, 2018 7:08 pm

I guess I really don't understand your dilemma.
I don't understand this issue either. It doesn't seem to make much sense. I have even setup and run dhcp server in dnsmasq on a laptop running debian openbox and connecting both the laptop and raspi in question to a switch. But the raspi just simply doesn't seem to request an IP addy.

I have simply killed the power as another post here suggests (certainly makes me cringe doing so, but) since it is headless and I have no monitor available to login locally. After power is restored the raspi looks fine: thered LED in the back and the two LEDs on the ETH port are illuminated, but it just doesn't seem to request an IP.

Now I have 2 raspis, got them at the same time from the same vendor (hrmmm) and they have both done the exact same thing. Although since re-flashing the second one I have just avoided any sort of re-boot that will inevitably have to be done at some point.

Just plain PITA weird.

mattmiller
Posts: 1834
Joined: Thu Feb 05, 2015 11:25 pm

Re: network services seem unavail after shutdown -r/h

Fri Jan 05, 2018 8:55 pm

I have simply killed the power as another post here suggests (certainly makes me cringe doing so, but) since it is headless and I have no monitor available to login locally. After power is restored the raspi looks fine: thered LED in the back and the two LEDs on the ETH port are illuminated, but it just doesn't seem to request an IP.
At least we've eliminated the shutdown command as the source of the issue

Return to “Beginners”

Who is online

Users browsing this forum: jbudd and 56 guests