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-Software | Single missing white space and many minor code improvements #2277

Merged
merged 2 commits into from
Nov 25, 2018

Conversation

MichaIng
Copy link
Owner

@MichaIng MichaIng commented Nov 24, 2018

Status: Ready

  • Test NTP error handling
  • Careful review 😉

Commit list/description:

  • DietPi-Software | Single missing white space and many minor code improvements

+ DietPi-Software | Single missing white space and many minor code improvements
@MichaIng MichaIng added this to the v6.18 milestone Nov 24, 2018
@MichaIng MichaIng self-assigned this Nov 24, 2018
@MichaIng MichaIng requested a review from Fourdee November 24, 2018 17:27
#NTPD
while :
# Timesync
until /DietPi/dietpi/func/run_ntpd
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaIng

Nice 👍

@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

@MichaIng

Looks good, will merge and test 👍

  • 🈴 PiVPN install, stuck in loop,
:::
::: You are root.
::: Verifying free disk space...
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your system is up to date! Continuing with PiVPN installation...
:::
::: You are root.
::: Verifying free disk space...
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your system is up to date! Continuing with PiVPN installation...
#### DietPi retry on failure prompt
  • 🈯️ NTPD sync

@Fourdee Fourdee merged commit d2d93dc into dev Nov 25, 2018
@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

🈴 PiVPN installer exists after configuring openvpn server, no error. Not related to this PR.

root@DietPi:/home/pivpn# ./pivpn_install.sh
:::
::: You are root.
::: Verifying free disk space...
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your system is up to date! Continuing with PiVPN installation...

Strange, resolved after:

root@DietPi:/home/pivpn# apt-get install openvpn
Reading package lists... Done
Building dependency tree
Reading state information... Done
openvpn is already the newest version (2.4.0-6+deb9u2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up iptables-persistent (1.0.4+nmu2) ...
insserv: warning: script 'K01uart_init.sh' missing LSB tags and overrides
insserv: warning: script 'link_monitor.sh' missing LSB tags and overrides
insserv: warning: script 'uart_init.sh' missing LSB tags and overrides
Setting up openvpn (2.4.0-6+deb9u2) ...
[ ok ] Restarting virtual private network daemon.:.
Created symlink /etc/systemd/system/multi-user.target.wants/openvpn.service → /lib/systemd/system/openvpn.service.
insserv: warning: script 'K01uart_init.sh' missing LSB tags and overrides
insserv: warning: script 'link_monitor.sh' missing LSB tags and overrides
insserv: warning: script 'uart_init.sh' missing LSB tags and overrides
W: APT had planned for dpkg to do more than it reported back (0 vs 7).
   Affected packages: iptables-persistent:armhf openvpn:armhf

Will try to replicate.

Fourdee referenced this pull request Nov 25, 2018
+ Handle pivpn pre-req install ourselves: https://github.com/Fourdee/DietPi/pull/2277/
@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

rsyslog issue:

Setting up rsyslog (8.24.0-1) ...
Created symlink /etc/systemd/system/syslog.service → /lib/systemd/system/rsyslog.service.
Created symlink /etc/systemd/system/multi-user.target.wants/rsyslog.service → /lib/systemd/system/rsyslog.service.
Job for rsyslog.service failed because the control process exited with error code.
See "systemctl status rsyslog.service" and "journalctl -xe" for details.
invoke-rc.d: initscript rsyslog, action "start" failed.
● rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sun 2018-11-25 18:20:55 GMT; 21ms ago
     Docs: man:rsyslogd(8)
           http://www.rsyslog.com/doc/
  Process: 9578 ExecStart=/usr/sbin/rsyslogd -n (code=exited, status=1/FAILURE)
 Main PID: 9578 (code=exited, status=1/FAILURE)

Nov 25 18:20:55 DietPi systemd[1]: rsyslog.service: Unit entered failed state.
Nov 25 18:20:55 DietPi systemd[1]: rsyslog.service: Failed with result 'exi…de'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package rsyslog (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (232-25+deb9u6) ...
Errors were encountered while processing:
 rsyslog
E: Sub-process /usr/bin/dpkg returned an error code (1)

Yet:

root@DietPi:~# systemctl status rsyslog.service -l
● rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset:
enabled)
   Active: active (running) since Sun 2018-11-25 18:20:55 GMT; 50s ag
o
     Docs: man:rsyslogd(8)
           http://www.rsyslog.com/doc/
 Main PID: 9595 (rsyslogd)
   CGroup: /system.slice/rsyslog.service
           └─9595 /usr/sbin/rsyslogd -n

Nov 25 18:20:55 DietPi systemd[1]: Starting System Logging Service...
Nov 25 18:20:55 DietPi liblogging-stdlog[9595]:  [origin software="rsyslogd" swV
ersion="8.24.0" x-pid="9595" x-info="http://www.rsyslog.com"] start
Nov 25 18:20:55 DietPi systemd[1]: Started System Logging Service.

@MichaIng MichaIng deleted the dietpi-software branch November 25, 2018 18:28
@MichaIng
Copy link
Owner Author

MichaIng commented Nov 25, 2018

@Fourdee
Where does rsyslog come from? If it's a pre-req anyway, perhaps we should mark it for install (add as dependency) within dietpi-software beforehand?

€: Ah already the case, same with GIT:

aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1
aSOFTWARE_REQUIRES_GIT[$software_id]=1

So install fails outside of PiVPN?

@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

@MichaIng

The issue is with rsyslog install in general. APT reports failure as service is not started, yet if you check status straight afterwards, it is running fine.

🈯️ Found the issue, if rsyslog service is running, but not installed, the apt installation will fail.

Added a workaround for now.

If it's a pre-req anyway, perhaps we should mark it for install (add as dependency) within dietpi-software beforehand?

Already in code aSOFTWARE_REQUIRES_RSYSLOG[$software_id]=1

Where does rsyslog come from?

Unsure, will need to dig up old git tickets, but will be a reason.

@MichaIng
Copy link
Owner Author

Just checked here and rsyslog installed without an issue:

Processing triggers for systemd (232-25+deb9u6) ...
Setting up rsyslog (8.24.0-1) ...
Created symlink /etc/systemd/system/syslog.service → /lib/systemd/system/rsyslog.service.
Created symlink /etc/systemd/system/multi-user.target.wants/rsyslog.service → /lib/systemd/system/rsyslog.service.
Processing triggers for systemd (232-25+deb9u6) ...
root@VM-Stretch:/mnt/dietpi_userdata/syncthing#

Which device did you test with?

Fourdee referenced this pull request Nov 25, 2018
- DietPi-Software | Resolved an issue where rsyslog APT installation would report a failure, if service was already running previously but not installed via APT (mostly in backup/restore situations): https://github.com/Fourdee/DietPi/pull/2277/#issuecomment-441461982
@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

@MichaIng

Found the issue, if rsyslog service is running, but not installed, the apt installation will fail.

Mostly occurs due to restore if rsyslog was previously installed, but not on the backup.

I really should take note of after restore
"it is highly recommended to reboot the system"
🤣

@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

@MichaIng

ARMv7/v8

PiVPN still failing, most likely due to this prompt:

@MichaIng
Copy link
Owner Author

@Fourdee
Ah okay, rare strange case at least. We could stop rsyslog on dietpi-update restore, but cannot be sure that it is an issue for other packages/services as well. Yeah at best a restart should be done after restoring a backup 😉.

About PiVPN:
Hmm, just tested on my VM and the prompt does not appear. Perhaps only, if there are some iptables rules active currently?

@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

Ah okay, rare strange case at least. We could stop rsyslog on dietpi-update restore, but cannot be sure that it is an issue for other packages/services as well. Yeah at best a restart should be done after restoring a backup 😉.

Yep.

Perhaps only, if there are some iptables rules active currently?

Fresh image, no iptables.

Works fine if we handle the APT packages.

@MichaIng
Copy link
Owner Author

@Fourdee
Ah I think I got it. PiVPN does not like whiptail menus (required user inputs) during it's APT install calls. Bad if those are required. Again something we can open a ticket for 😉.

What I don't like about the current installer as well in combination with DietPi is, that it asks/strongly recommends a reboot. But this will break our install 🤔. Not sure if it's possible to somehow automate this question?

@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

@MichaIng

Already done, prevents reboot, even if selected.
# - Disable reboot
sed -i '/shutdown[[:space:]]/d' pivpn_install.sh

@Fourdee
Copy link
Collaborator

Fourdee commented Nov 25, 2018

Test:

  • 🈯️ ARMv7 C2
  • 🈯️ ARMv7 ASUS TB
  • 🈯️ ARMv8 NanoPi T4

Done.

@Fourdee Fourdee mentioned this pull request Nov 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants