Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Boot | "[FAILED] Failed to start Daily apt download activities." #1330

Closed
MichaIng opened this issue Dec 22, 2017 · 12 comments
Closed
Labels
Known Issue 🐛 Solution available 🥂 Definite solution has been done
Milestone

Comments

@MichaIng
Copy link
Owner

See this error on every VirtualBox VM (Jessie+Stretch+Buster) and if I remember right also on my RPi:
[FAILED] Failed to start Daily apt download activities.

I remember a commit where we disabled daily apt update, but maybe we can somehow disable the error message?


Different error on reboot/shutdown, one of the last messages:
Failed to start Shutdown all ssh sessions before network.


Both minor, but just to have it mentioned somwhere

@DarkElvenAngel
Copy link

DarkElvenAngel commented Dec 22, 2017

@MichaIng The file /etc/systemd/system/apt-daily.service is a link that points to /dev/null this is what is giving you the error.

I deleted the link and replace the apt-daily.service with this

Description=Apt-daily

[Service]
Type=simple
User=root
ExecStart=/bin/false

[Install]
WantedBy=multi-user.target

That will get rid of the error on the bootup.

@Fourdee
Copy link
Collaborator

Fourdee commented Dec 22, 2017

Reason for mask:

  • the service instigates a apt-cache/dpkg lock during updates (daily), which will break dietpi-software and any apt installations.
  • DietPi runs G_AGUP as needed.

@MichaIng
Copy link
Owner Author

@DarkElvenAngel

Thanks for solution. Simple and clean by dummy service file.

Just for interest, I will try to have a look where the error is produced, maybe we can stop the execution/error msg at it's root.

@MichaIng MichaIng added the Solution available 🥂 Definite solution has been done label Dec 22, 2017
@DarkElvenAngel
Copy link

@MichaIng

I'm not sure I already tried finding the source. I was looking for symlinks to apt-daily.system but I may have already deleted them. but they would be in /etc/systemd/ somewhere if they exists otherwise some other part of the boot process is trying to start the service in another way.

Good luck

@MichaIng
Copy link
Owner Author

@DarkElvenAngel
Replacing /etc/systemd/system/apt-daily.service by the dummy service as mentioned above just worked fine, error is gone 🙂!

@MichaIng
Copy link
Owner Author

About the ssd stop error:
Found the commit, that was meant to stop error messages: Fourdee@0e9806d#diff-e9e0c6c64b4937739e13ffac58f4a888R290
However systemd seems to have it's own error handling that does not rely on command outputs.

I trief ExecStart=/bin/bash -c '( ps -A | grep sshd ) && killall sshd; ( ps -A | grep dropbear ) && killall dropbear' to do killall only, if process does exist, but the error is just the same. Maybe something else with the service is not right, I am not too deep in this, or simply this commands cannot be run/are not available anymore on shutdown?

@Fourdee
Maybe you have an idea how to suppress this?

@Fourdee
Copy link
Collaborator

Fourdee commented Dec 27, 2017

@MichaIng

Maybe you have an idea how to suppress this?

Not sure, probably needs a full bash script that we can control, check for process/installed service and control it that way. Or systemctl stop dropbear in the service, or something similar.

I'd need to take a stab at it.

@MichaIng
Copy link
Owner Author

@Fourdee
Replacing killall by systemctl stop leads to disappearing error message.

The error message only shows up on reboot/shutdown directly on machine terminal, if no SSH session is opened. Persistent system logs need to be enabled to see it after reboot, as it shows up on terminal very short. So to replicate:

  1. Use any VirtualBox image, should show up also on all other devices.
  2. Start without SSH, directly machines terminal instead and with no SSH session active.
  3. mkdir /var/log/journal
  4. service systemd-journald restart
  5. reboot
  6. journalctl -p err -t systemd
  7. find Failed to start Shutdown all ssh sessions before network. directly before reboot

To solve error message:

  1. sed -i 's/killall/systemctl stop/g' /etc/systemd/system/kill-ssh-user-sessions-before-network.service
  2. reboot
  3. journalctl -p err -t systemd

BUT:

  • systemctl stop dropbear does not quit the current dropbear session, just the listening daemon (2. process)
  • So I am not sure what the intention of the service is. Clear signal/message to/on ssh client (putty) that connection was closed on reboot/shutdown only works with killall.

It is finally a bid strange for me, as the service should not know whether it closes daemon AND actual ssh session or just daemon, and in case should not fail, if only a daemon was found. Also on my machine there is no openssh/sshd, thus the first killall sshd anyway 'fails'.

@Fourdee
Copy link
Collaborator

Fourdee commented Dec 28, 2017

@MichaIng

Just a quick look over this:

  • Dropbear is a sysinit service /etc/init.d/dropbear. We could probably create our own SystemD one with the additional killall command to kill SSH connections during shutdown.
    -- This all being that OpenSSH no longer requires the the additional killall, nope, it still requires the custom killall.

@MichaIng
I think a bash script to cover both killall and auto detection of Dropbear and OpenSSH, that we can control solution here?


Should be resolved with (Fourdee@8b2dac6) need to verify with testing later:
[] ensures it does scrape the grep process as a match, as entry must start with the first letter in bracket.

cat << _EOF_ > /etc/systemd/system/kill-ssh-user-sessions-before-network.service
[Unit]
Description=Shutdown all ssh sessions before network
DefaultDependencies=no
Before=network.target shutdown.target

[Service]
Type=oneshot
#ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null'
ExecStart=/bin/bash -c '/var/lib/dietpi/dietpi-software/services/kill-ssh-user-sessions-before-network.sh'

[Install]
WantedBy=poweroff.target halt.target reboot.target
_EOF_
	systemctl daemon-reload
	systemctl enable kill-ssh-user-sessions-before-network

	cat << _EOF_ > /var/lib/dietpi/dietpi-software/services/kill-ssh-user-sessions-before-network.sh
#!/bin/bash
if (( $(ps x | grep -ci -m1 '[s]shd' ) )); then

    killall -w sshd

elif (( $(ps x | grep -ci -m1 '[d]ropbear' ) )); then

    killall -w dropbear

fi

exit 0
_EOF_
	chmod +x /var/lib/dietpi/dietpi-software/services/kill-ssh-user-sessions-before-network.sh

Fourdee referenced this issue Dec 28, 2017
+ General | Fix for kill-ssh-user-sessions-before-network.service
reporting failed during shutdown:
https://github.com/Fourdee/DietPi/issues/1330
@MichaIng
Copy link
Owner Author

@Fourdee
Works on my VMs on Jessie+Stretch+Buster 👍.

@apt-daily.service

  • There are three other services: apt-daily.timer, apt-daily-upgrade.service, apt-daily-upgrade.timer and the last two wait for the first and our masked service to start. I guess this the reason, why systemd wants to start them/see them start and even knows the masked services description text.
  • So simple solution is to mask all 4 services, as apt upgrade anyway does not make any sense without apt update ;).

@MichaIng
Copy link
Owner Author

Fixed and merged changelog: https://github.com/Fourdee/DietPi/pull/1348

@MichaIng MichaIng added this to the v160 milestone Dec 28, 2017
@Fourdee
Copy link
Collaborator

Fourdee commented Dec 30, 2017

@MichaIng

Fixed and merged changelog: #1348

Thanks 👍

I'll mark this as closed.

@Fourdee Fourdee closed this as completed Dec 30, 2017
@Fourdee Fourdee mentioned this issue Jan 28, 2018
Fourdee referenced this issue Jan 28, 2018
**v6.0** (previously v160)
(28/01/18)

**Important Information:**
**All DietPi images have been re-created. Existing installations (v159 or lower), can no longer be updated, or supported. To continue support, users must install the latest v6.0 image.**
 - https://github.com/Fourdee/DietPi/issues/1385
 - All images are now Debian Stretch (excluding Odroid's)
 - ARMbian based images are now mainline kernel 4.13+.
 - Native PC (EFI): is now an ISO, with clonezilla bundled. Simplifies installation via Rufus write: https://github.com/Fourdee/DietPi/issues/1171#issuecomment-336522021
 - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot continue to provide support for v159 (or lower) installations.

**Minor notes:**
The XMAS tree has now been taken down, stored away on github history for next year. Hope you all had a good one :D

**Changes / Improvements / Optimizations:**

General | DietPi RPi kernel, now reverted to stock RPi kernel: https://github.com/Fourdee/DietPi/issues/1378

General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals.

DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options: https://github.com/Fourdee/DietPi/issues/1311

General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RAMlog store has moved to /var/tmp/dietpi: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193

General | We have refreshed our terminal messages look & feel, oriented on RPi boot messages, and with process animation: https://github.com/Fourdee/DietPi/pull/1377

General | wget: Now set to prefer IPv4 by default (generally faster, can be changed by 'CONFIG_PREFER_IPVERSION' in dietpi.txt): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187

General | APT: Now set to force IPv4 by default (generally faster, can be changed by 'CONFIG_PREFER_IPVERSION' in dietpi.txt): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187

General | SparkySBC: CPU gov default changed to Performance, reports of increased stability.

General | Swapfile generation is now completed during 1st run of dietpi-software (previously boot stage): https://github.com/Fourdee/DietPi/issues/1270#issue-278797206

General | DietPi-Funtime: Removed from DietPi. Although it looked pretty, it did absolutely nothing (except slow down a program)

DietPi-Automation | All dietpi.txt entries have been renamed and cleaned up.

DietPi-Automation | dietpi.txt: CONFIG_NTP_MODE will now be applied during 1st run of device: https://github.com/Fourdee/DietPi/issues/1379

DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930

DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0)

DietPi-Config | Dion Audio LOCO V1/V2: Soundcards added for RPi.

DietPi-Config | Locale: en_GB.UTF-8 is now automatically installed, alongside user selected choice. Required for DietPi scripts to function.

DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312

DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/Fourdee/DietPi/issues/1311

DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301

DietPi-Set_Software | "pool" directive is now used for NTPD: https://github.com/Fourdee/DietPi/pull/1404

DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305

DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298

DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055

DietPi-Software | ownCloud/Nextcloud: Switch to pretty URLs (without "index.php") on Apache

DietPi-Software | ownCloud/Nextcloud: Automated backup restoring on install and creation und uninstall to ownCloud/Nextcloud data directory

DietPi-Software | ownCloud: Switch to non-package/archive installation. This allows usage of preferred web based updater.

DietPi-Software | Nextcloud: Resolved OPcache admin panel warnings now also on Lighttpd

DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335

DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318

DietPi-Software | SqueezeBox/LMS (Stretch): Installation resolved: https://github.com/Fourdee/DietPi/issues/1124

DietPi-Software | MySQL: Completely remove MySQL from DietPi in favour of MariaDB: https://github.com/Fourdee/DietPi/issues/1397

DietPi-Software | Ampache: MySQL DB and configs have been updated (adds correct userdata folder for music by default): https://github.com/Fourdee/DietPi/issues/1420

run_ntpd | Added support for systemd-timesyncd completion/detection: https://github.com/Fourdee/DietPi/issues/1379

**Bug Fixes:**

General | Fixed two systemd error messages during shutdown and boot: https://github.com/Fourdee/DietPi/issues/1330

DietPi-Automation | Resolved an issue where AUTO_SETUP_TIMEZONE was not being applied correctly, thanks @k-plan: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-356310496

DietPi-Automation | dietpi.txt: CONFIG_NTP_MIRROR will now be applied to systemd-timesyncd configuration: https://github.com/Fourdee/DietPi/issues/1379

DietPi-Config | Resolved an issue with WiFi Country code, failing to set on some devices: https://github.com/Fourdee/DietPi/issues/838

DietPi-Config | Resolved an issue where disabling IPv6 didn't have an effect on AMD64 devices: https://github.com/Fourdee/DietPi/issues/1343#issuecomment-359652751

DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480

DietPi-Software | General: MySQL using software titles now have their own database user, instead of accessing as "root": https://github.com/Fourdee/DietPi/issues/1397#issuecomment-359655198

DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366

DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329

DietPi-Software | Resolved an issue where APT installations would fail if services were masked. All known 

DietPi software services, will be enabled/unmasked, before installation: https://github.com/Fourdee/DietPi/issues/1320

DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299

DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303

DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge).

DietPi-Software | MariaDB: Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280

DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/Fourdee/DietPi/issues/1310

DietPi-Software | Mosquitto: Resolved various issues with failed install, due to Mosq repo not being maintained (deb's missing from repo header list, requires non-stretch available packages). deb's are now hosted on dietpi.com: https://github.com/Fourdee/DietPi/issues/1306

DietPi-Software | ownCloud/Nextcloud: Fixed an installation issue on Jessie with MariaDB: https://github.com/Fourdee/DietPi/pull/1319

DietPi-Software | Google AIY: Updated install to gitbranch=voicekit. Many thanks to @mpember for the heads up: https://github.com/Fourdee/DietPi/issues/1065#issuecomment-354304388

DietPi-Software | OpenJDK: Replaces OracleJDK: https://github.com/Fourdee/DietPi/issues/1401

DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969

Sparky SBC | Kernel updated, which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100

**Allo Web Interface v5:**

Sparky SBC: Matrix Audio X-SPDIF 2, native DSD is now added to kernel, many thanks @sudeep: sparkysbc/Linux#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Known Issue 🐛 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

No branches or pull requests

3 participants