Saturday, 27 July 2019

systemd problems on Raspian Buster - radicale, isc-dhcp-server, sshd, apache2

After reboot, radicale and isc-dhcp-server don't start.  Or, rather, radicale starts and then exits.

apache2 and sshd ports have been configured so that ssh over port 80 to a separate ip number is possible

sshd starts but not all ports are assigned

Jul 27 14:51:04 arcticus sshd[536]: error: Bind to port 22 on 2001:8b0:7c:1::154 failed: Cannot assign requested address.
Jul 27 14:51:04 arcticus sshd[536]: error: Bind to port 22 on 90.155.48.154 failed: Cannot assign requested address.
Jul 27 14:51:04 arcticus sshd[536]: error: Bind to port 443 on 2001:8b0:7c:1::136 failed: Cannot assign requested address.
Jul 27 14:51:04 arcticus sshd[536]: error: Bind to port 80 on 2001:8b0:7c:1::136 failed: Cannot assign requested address.
Jul 27 14:51:04 arcticus sshd[536]: Server listening on 90.155.48.136 port 443.
Jul 27 14:51:04 arcticus sshd[536]: Server listening on 90.155.48.136 port 80.
Jul 27 14:51:04 arcticus sshd[536]: Server listening on 81.187.211.34 port 22.
Jul 27 14:51:04 arcticus sshd[536]: Server listening on 2001:8b0:7c:1::138 port 22.
Jul 27 14:51:04 arcticus sshd[536]: error: Bind to port 22 on 90.155.48.138 failed: Cannot assign requested address.


apache 2 fails to start

The radicale, isc-dhcp-server and apache2 problems are detectable using "systemctl show" as the failure is detectable

LoadState=loaded
ActiveState=active
SubState=exited

I've created a root cron job to run, probably,  once a day, to check and restart if neccessary, the services

For example, for radicale

#!/bin/bash
# Run with root crontab once each day
# --------------------------------------------------------------------------
# radicale shows on reboot:
# LoadState=loaded
# ActiveState=active
# SubState=exited
/bin/echo "Checking radicale"
/bin/systemctl show radicale.service | /bin/grep -i SubState=running
radicale_rc=${?}
if [[ ${radicale_rc} -ne 0 ]]; then
/bin/echo "radicale not running"
/bin/systemctl restart radicale.service
/bin/systemctl show radicale.service | /bin/grep -i SubState=running
radicale_rc=${?}
if [[ ${radicale_rc} -eq 0 ]]; then
/bin/echo "radicale running"
fi
else
/bin/echo "radicale running"
fi

It is more difficult to check the sshd error as sshd is started.  I'm using a rather dirty hack of checking if apache2 is running and, if not, restart sshd.



Sunday, 14 July 2019

Sendmail problems with Raspbian Buster

"5.7.0 Authentication required" error in Thunderbird on my Macbook when trying to use Sendmail on my Pi for outgoing mail.  Also Alpine in a ssh shell would not send.

By comparing the setup with my exist PI, I eventually discovered that libsasl2-modules was not installed.

Labels: , , , , , ,

Multiple ipv4 and ipv6 addresses without /etc/network/interfaces on Raspberry Pi Raspian Buster

I decided to avoid /etc/network/interfaces with a new install on a Pi 3 and use dhcpcd.

Found searching the internet that I needed an entry in /etc/rc.local

ifconfig eth0:1 add 2001:8b0:7c:1::136
ifconfig eth0:1 90.155.48.136
ifconfig eth0:2 81.187.211.34

Labels: , , , , , , ,