I see what you are saying. If that is the case you should just have to adjust the hwclock.sh yes?
This line:
[ -e /dev/rtc0 ] && return 0;
I see what you are saying. If that is the case you should just have to adjust the hwclock.sh yes?
This line:
[ -e /dev/rtc0 ] && return 0;
Yes i did it before, see here:
#!/bin/sh
# hwclock.sh Set and adjust the CMOS clock.
#
# Version: @(#)hwclock.sh 2.00 14-Dec-1998 miquels@cistron.nl
#
# Patches:
# 2000-01-30 Henrique M. Holschuh <hmh@rcm.org.br>
# - Minor cosmetic changes in an attempt to help new
# users notice something IS changing their clocks
# during startup/shutdown.
# - Added comments to alert users of hwclock issues
# and discourage tampering without proper doc reading.
# 2012-02-16 Roger Leigh <rleigh@debian.org>
# - Use the UTC/LOCAL setting in /etc/adjtime rather than
# the UTC setting in /etc/default/rcS. Additionally
# source /etc/default/hwclock to permit configuration.
# WARNING: Please read /usr/share/doc/util-linux/README.Debian.hwclock
# before changing this file. You risk serious clock
# misbehaviour otherwise.
init_rtc_device()
{
[ -e /dev/rtc1 ] && return 0;
# load i2c and RTC kernel modules
modprobe i2c-dev
modprobe rtc-ds1307
# iterate over every i2c bus to support Pi v1 and Pi v2
# (different I2C busses on GPIO header!)
for bus in $(ls -d /sys/bus/i2c/devices/i2c-*);
do
echo ds1307 0x68 >> $bus/new_device;
#check if RTC found and if not delete device and try again
if [ -e /dev/rtc1 ]; then
log_action_msg "RTC found on bus `cat $bus/name`";
break; # found the RTC so break out of loop
else
echo 0x68 >> $bus/delete_device
fi
done
}
init_rtc_device
### BEGIN INIT INFO
# Provides: hwclock
# Required-Start: mountdevsubfs
# Required-Stop: $local_fs
# Default-Start: S
# X-Start-Before: checkroot
# Default-Stop: 0 6
### END INIT INFO
# These defaults are user-overridable in /etc/default/hwclock
BADYEAR=no
HWCLOCKACCESS=yes
HWCLOCKPARS=
HCTOSYS_DEVICE=rtc0
# We only want to use the system timezone or else we'll get
# potential inconsistency at startup.
unset TZ
hwclocksh()
{
[ ! -x /sbin/hwclock ] && return 0
[ ! -r /etc/default/rcS ] || . /etc/default/rcS
[ ! -r /etc/default/hwclock ] || . /etc/default/hwclock
. /lib/lsb/init-functions
verbose_log_action_msg() { [ "$VERBOSE" = no ] || log_action_msg "$@"; }
case "$BADYEAR" in
no|"") BADYEAR="" ;;
yes) BADYEAR="--badyear" ;;
*) log_action_msg "unknown BADYEAR setting: \"$BADYEAR\""; return 1 ;;
esac
case "$1" in
start)
# If the admin deleted the hwclock config, create a blank
# template with the defaults.
if [ -w /etc ] && [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then
printf "0.0 0 0.0\n0\nUTC" > /etc/adjtime
fi
# Commented out because Raspberry Pi doesn't have udev detectable RTC
#if [ -d /run/udev ] || [ -d /dev/.udev ]; then
#return 0
#fi
if [ "$HWCLOCKACCESS" != no ]; then
log_action_msg "Setting the system clock"
# Just for reporting.
if head -n 3 /etc/adjtime | tail -n 1 | grep -q '^UTC$' ; then
UTC="--utc"
else
UTC=
fi
# Copies Hardware Clock time to System Clock using the correct
# timezone for hardware clocks in local time, and sets kernel
# timezone. DO NOT REMOVE.
if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --hctosys $HWCLOCKPARS $BADYEAR; then
# Announce the local time.
verbose_log_action_msg "System Clock set to: `date $UTC`"
else
log_warning_msg "Unable to set System Clock to: `date $UTC`"
fi
else
verbose_log_action_msg "Not setting System Clock"
fi
;;
stop|restart|reload|force-reload)
#
# Updates the Hardware Clock with the System Clock time.
# This will *override* any changes made to the Hardware Clock.
#
# WARNING: If you disable this, any changes to the system
# clock will not be carried across reboots.
#
if [ "$HWCLOCKACCESS" != no ]; then
log_action_msg "Saving the system clock"
if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc $HWCLOCKPARS $BADYEAR; then
verbose_log_action_msg "Hardware Clock updated to `date`"
fi
else
verbose_log_action_msg "Not saving System Clock"
fi
;;
show)
if [ "$HWCLOCKACCESS" != no ]; then
/sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --show $HWCLOCKPARS $BADYEAR
fi
;;
*)
log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}"
log_success_msg " start sets kernel (system) clock from hardware (RTC) clock"
log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock"
return 1
;;
esac
}
hwclocksh "$@"
Alles anzeigen
You rebooted and it did not start the ntp server?
Did you do this again before reboot?
update-rc.d -f hwclock.sh remove
update-rc.d hwclock.sh defaults
Yes it will not start the ntp server abnd yes i did this
I rebooted it again:
ZitatAlles anzeigenroot@Hermes:~# date
Sa 21. Mai 17:12:15 CEST 2016
root@Hermes:~# ntpq -p
ntpq: read: Connection refused
root@Hermes:~# service ntp restart
Stopping NTP server: ntpdstart-stop-daemon: warning: failed to kill 2191: No such process
.
Starting NTP server: ntpd.
ZitatAlles anzeigenMay 21 17:12:42 Hermes ntpd[2982]: ntpd 4.2.6p5@1.2349-o Wed Oct 28 20:43:38 UTC 2015 (1)
May 21 17:12:42 Hermes ntpd[2983]: proto: precision = 0.500 usec
May 21 17:12:42 Hermes ntpd[2983]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
May 21 17:12:42 Hermes ntpd[2983]: Listen and drop on 1 v6wildcard :: UDP 123
May 21 17:12:42 Hermes ntpd[2983]: Listen normally on 2 lo 127.0.0.1 UDP 123
May 21 17:12:42 Hermes ntpd[2983]: Listen normally on 3 eth0 192.168.0.50 UDP 123
May 21 17:12:42 Hermes ntpd[2983]: Listen normally on 4 lo ::1 UDP 123
May 21 17:12:42 Hermes ntpd[2983]: peers refreshed
May 21 17:12:42 Hermes ntpd[2983]: Listening on routing socket on fd #21 for interface updates
May 21 17:12:42 Hermes ntpd[2983]: format error frequency file /var/lib/ntp/ntp.drift
May 21 17:12:42 Hermes ntpd[2983]: Cannot find user ID 101
Here you can see the kernel messages:
ZitatAlles anzeigenMay 21 17:23:21 Hermes kernel: [ 16.534012] rtc-ds1307: probe of 0-0068 failed with error -5
May 21 17:23:21 Hermes kernel: [ 16.551807] i2c i2c-0: new_device: Instantiated device ds1307 at 0x68
May 21 17:23:21 Hermes kernel: [ 16.570427] i2c i2c-0: delete_device: Deleting device ds1307 at 0x68
May 21 17:23:21 Hermes kernel: [ 16.591286] rtc-ds1307: probe of 1-0068 failed with error -5
May 21 17:23:21 Hermes kernel: [ 16.608954] i2c i2c-1: new_device: Instantiated device ds1307 at 0x68
May 21 17:23:21 Hermes kernel: [ 16.627408] i2c i2c-1: delete_device: Deleting device ds1307 at 0x68
May 21 17:23:21 Hermes kernel: [ 16.649112] rtc-ds1307 2-0068: rtc core: registered ds1307 as rtc1
May 21 17:23:21 Hermes kernel: [ 16.671817] rtc-ds1307 2-0068: 56 bytes nvram
May 21 17:23:21 Hermes kernel: [ 16.687867] i2c i2c-2: new_device: Instantiated device ds1307 at 0x68
I think the key to your problem is in this message...
May 21 17:12:42 Hermes ntpd[2983]: Cannot find user ID 101
I look at something...
I wonder why your module fails to register 2 times and the it succeeds.
I checked my kernel log and mine registers the first try.
Did you edit this line in the hwclock.sh???
HCTOSYS_DEVICE=rtc0
Maybe this is your last problem...
Unfortunatly not:
Zitatroot@Hermes:~# date
Sa 21. Mai 18:02:38 CEST 2016
root@Hermes:~# service ntp restart
Stopping NTP server: ntpdstart-stop-daemon: warning: failed to kill 2201: No such process
.
Starting NTP server: ntpd.
ZitatAlles anzeigenMay 21 18:02:50 Hermes ntpd[4068]: ntpd 4.2.6p5@1.2349-o Wed Oct 28 20:43:38 UTC 2015 (1)
May 21 18:02:50 Hermes ntpd[4069]: proto: precision = 0.500 usec
May 21 18:02:50 Hermes ntpd[4069]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
May 21 18:02:50 Hermes ntpd[4069]: Listen and drop on 1 v6wildcard :: UDP 123
May 21 18:02:50 Hermes ntpd[4069]: Listen normally on 2 lo 127.0.0.1 UDP 123
May 21 18:02:50 Hermes ntpd[4069]: Listen normally on 3 eth0 192.168.0.50 UDP 123
May 21 18:02:50 Hermes ntpd[4069]: Listen normally on 4 lo ::1 UDP 123
May 21 18:02:50 Hermes ntpd[4069]: peers refreshed
May 21 18:02:50 Hermes ntpd[4069]: Listening on routing socket on fd #21 for interface updates
May 21 18:02:50 Hermes ntpd[4069]: format error frequency file /var/lib/ntp/ntp.drift
May 21 18:02:50 Hermes ntpd[4069]: Cannot find user ID 101
ZitatAlles anzeigenMay 21 18:00:18 Hermes kernel: [ 16.443083] rtc-ds1307: probe of 0-0068 failed with error -5
May 21 18:00:18 Hermes kernel: [ 16.460921] i2c i2c-0: new_device: Instantiated device ds1307 at 0x68
May 21 18:00:18 Hermes kernel: [ 16.479531] i2c i2c-0: delete_device: Deleting device ds1307 at 0x68
May 21 18:00:18 Hermes kernel: [ 16.500389] rtc-ds1307: probe of 1-0068 failed with error -5
May 21 18:00:18 Hermes kernel: [ 16.518098] i2c i2c-1: new_device: Instantiated device ds1307 at 0x68
May 21 18:00:18 Hermes kernel: [ 16.536550] i2c i2c-1: delete_device: Deleting device ds1307 at 0x68
May 21 18:00:18 Hermes kernel: [ 16.558267] rtc-ds1307 2-0068: rtc core: registered ds1307 as rtc1
May 21 18:00:18 Hermes kernel: [ 16.574334] rtc-ds1307 2-0068: 56 bytes nvram
May 21 18:00:18 Hermes kernel: [ 16.590399] i2c i2c-2: new_device: Instantiated device ds1307 at 0x68
ZitatAlles anzeigen#!/bin/sh
# hwclock.sh Set and adjust the CMOS clock.
#
# Version: @(#)hwclock.sh 2.00 14-Dec-1998 miquels@cistron.nl
#
# Patches:
# 2000-01-30 Henrique M. Holschuh <hmh@rcm.org.br>
# - Minor cosmetic changes in an attempt to help new
# users notice something IS changing their clocks
# during startup/shutdown.
# - Added comments to alert users of hwclock issues
# and discourage tampering without proper doc reading.
# 2012-02-16 Roger Leigh <rleigh@debian.org>
# - Use the UTC/LOCAL setting in /etc/adjtime rather than
# the UTC setting in /etc/default/rcS. Additionally
# source /etc/default/hwclock to permit configuration.
# WARNING: Please read /usr/share/doc/util-linux/README.Debian.hwclock
# before changing this file. You risk serious clock
# misbehaviour otherwise.
init_rtc_device()
{
[ -e /dev/rtc1 ] && return 0;
# load i2c and RTC kernel modules
modprobe i2c-dev
modprobe rtc-ds1307
# iterate over every i2c bus to support Pi v1 and Pi v2
# (different I2C busses on GPIO header!)
for bus in $(ls -d /sys/bus/i2c/devices/i2c-*);
do
echo ds1307 0x68 >> $bus/new_device;
#check if RTC found and if not delete device and try again
if [ -e /dev/rtc1 ]; then
log_action_msg "RTC found on bus `cat $bus/name`";
break; # found the RTC so break out of loop
else
echo 0x68 >> $bus/delete_device
fi
done
}
init_rtc_device
### BEGIN INIT INFO
# Provides: hwclock
# Required-Start: mountdevsubfs
# Required-Stop: $local_fs
# Default-Start: S
# X-Start-Before: checkroot
# Default-Stop: 0 6
### END INIT INFO
# These defaults are user-overridable in /etc/default/hwclock
BADYEAR=no
HWCLOCKACCESS=yes
HWCLOCKPARS=
HCTOSYS_DEVICE=rtc1
# We only want to use the system timezone or else we'll get
# potential inconsistency at startup.
unset TZ
hwclocksh()
{
[ ! -x /sbin/hwclock ] && return 0
[ ! -r /etc/default/rcS ] . /etc/default/rcS
[ ! -r /etc/default/hwclock ] . /etc/default/hwclock
. /lib/lsb/init-functions
verbose_log_action_msg() { [ "$VERBOSE" = no ] log_action_msg "$@"; }
case "$BADYEAR" in
no|"") BADYEAR="" ;;
yes) BADYEAR="--badyear" ;;
*) log_action_msg "unknown BADYEAR setting: \"$BADYEAR\""; return 1 ;;
esac
case "$1" in
start)
# If the admin deleted the hwclock config, create a blank
# template with the defaults.
if [ -w /etc ] && [ ! -f /etc/adjtime ] && [ ! -e /etc/adjtime ]; then
printf "0.0 0 0.0\n0\nUTC" > /etc/adjtime
fi
# Commented out because Raspberry Pi doesn't have udev detectable RTC
#if [ -d /run/udev ] [ -d /dev/.udev ]; then
#return 0
#fi
if [ "$HWCLOCKACCESS" != no ]; then
log_action_msg "Setting the system clock"
# Just for reporting.
if head -n 3 /etc/adjtime | tail -n 1 | grep -q '^UTC$' ; then
UTC="--utc"
else
UTC=
fi
# Copies Hardware Clock time to System Clock using the correct
# timezone for hardware clocks in local time, and sets kernel
# timezone. DO NOT REMOVE.
if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --hctosys $HWCLOCKPARS $BADYEAR; then
# Announce the local time.
verbose_log_action_msg "System Clock set to: `date $UTC`"
else
log_warning_msg "Unable to set System Clock to: `date $UTC`"
fi
else
verbose_log_action_msg "Not setting System Clock"
fi
;;
stop|restart|reload|force-reload)
#
# Updates the Hardware Clock with the System Clock time.
# This will *override* any changes made to the Hardware Clock.
#
# WARNING: If you disable this, any changes to the system
# clock will not be carried across reboots.
#
if [ "$HWCLOCKACCESS" != no ]; then
log_action_msg "Saving the system clock"
if /sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --systohc $HWCLOCKPARS $BADYEAR; then
verbose_log_action_msg "Hardware Clock updated to `date`"
fi
else
verbose_log_action_msg "Not saving System Clock"
fi
;;
show)
if [ "$HWCLOCKACCESS" != no ]; then
/sbin/hwclock --rtc=/dev/$HCTOSYS_DEVICE --show $HWCLOCKPARS $BADYEAR
fi
;;
*)
log_success_msg "Usage: hwclock.sh {start|stop|reload|force-reload|show}"
log_success_msg " start sets kernel (system) clock from hardware (RTC) clock"
log_success_msg " stop and reload set hardware (RTC) clock from kernel (system) clock"
return 1
;;
esac
}
hwclocksh "$@"
I think you where right, it is not the problem with the RTC it has something to do with "Cannot find user ID 101"
And meanwhile thank you so much for your time and help... where is the forum button to send someone the price of a (2,3,4,5...) beer(s) via paypal?
This I think has to do with the init script for ntp or user mismatch, something like this. But that variable ( HCTOSYS_DEVICE) definitely had to be fixed. You are getting closer.
Give me output of these:
getent passwd 101
getent passwd ntp
BTW, I think this will solve your problem.
mkdir /home/ntp
chown -R ntp:ntp /home/ntp
After creating this home see if the ntp server will start.
Also, I think the hwclock.sh and the RTC module are working fine. You can check with this.
hwclock -r
It is just home issue with ntp user I think.
Zitatroot@Hermes:~# getent passwd 101
ntp:x:101:103::/home/ntp:/bin/false
root@Hermes:~# getent passwd ntp
ntp:x:101:103::/home/ntp:/bin/false
hwclock -r is okay
Zitatroot@Hermes:~# hwclock -r
Sa 21 Mai 2016 21:00:25 CEST -1.599067 seconds
But still
ZitatCannot find user ID 101
If it didn't work delete the directory.
rm /home/ntp
I am still reading on this. I see lots of people that have this same issue but not solutions.
okay, so it is still the issue that rtc is working but is not synced by the ntp clock...
Maybe this will help, i will try it:
It is just a matter of the ntp server not starting. And why it is not reading the user in the init script.
In the start function of /etc/init.d/ntp try changing this line
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS
To this and see if it starts:
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE -c ntp:ntp
Good news!
The ID 101 is gone
ZitatAlles anzeigenMay 21 23:37:23 Hermes ntpd[2285]: proto: precision = 0.542 usec
May 21 23:37:23 Hermes ntpd[2285]: getconfig: Couldn't open <ntp:ntp>
May 21 23:37:23 Hermes ntpd[2285]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
May 21 23:37:23 Hermes ntpd[2285]: Listen and drop on 1 v6wildcard :: UDP 123
May 21 23:37:23 Hermes ntpd[2285]: Listen normally on 2 lo 127.0.0.1 UDP 123
May 21 23:37:23 Hermes ntpd[2285]: Listen normally on 3 eth0 192.168.0.50 UDP 123
May 21 23:37:23 Hermes ntpd[2285]: Listen normally on 4 lo ::1 UDP 123
May 21 23:37:23 Hermes ntpd[2285]: peers refreshed
May 21 23:37:23 Hermes ntpd[2285]: Listening on routing socket on fd #21 for interface updates
But what is getconfig: Couldn't open <ntp:ntp>?
Zitatroot@Hermes:~# service ntp restart
Stopping NTP server: ntpd.
Starting NTP server: ntpd.
Greetings Elluminatus
Show me your /etc/ntp.conf file:
cat /etc/ntp.conf
Now I am thinking there is just something wrong with this file.
Here we are... Fileserver was shutdown until today and the time was correct!
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Disable the panic feature.
tinker panic 0
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 0.de.pool.ntp.org iburst
server 1.de.pool.ntp.org iburst
server 2.de.pool.ntp.org iburst
server 3.de.pool.ntp.org iburst
# By default, exchange time with everybody, but do not allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
Alles anzeigen
Did you use a relatively new, or new USB Stick, when you installed the image for OMV??? I would be really curious how things would work for you if you used a new SD Card.
Not a USB Stick but a new SD-Card... 8GB brand new...
Sorry for interrupting this thread.
I added a weekly cron job to reboot. Now the most data I can lose on the graphs is 7 days or less.
Would you please be so kind and post the content of the files you changed for doing the weekly reboot? Thank you.
I was thinking of something similar, as I had a power outtake recently and due to the use of the folder2ram plugin i also lost some graphs.
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!