mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
eitd/sectionsd.cpp: check is /sbin/ntpdate present, use ntpd if not
This commit is contained in:
@@ -94,11 +94,7 @@ static bool messaging_zap_detected = false;
|
|||||||
//NTP-Config
|
//NTP-Config
|
||||||
#define CONF_FILE CONFIGDIR "/neutrino.conf"
|
#define CONF_FILE CONFIGDIR "/neutrino.conf"
|
||||||
|
|
||||||
#ifdef USE_BB_NTPD
|
std::string ntp_system_cmd_prefix = "/sbin/ntpdate ";
|
||||||
const std::string ntp_system_cmd_prefix = "/sbin/ntpd -q -p ";
|
|
||||||
#else
|
|
||||||
const std::string ntp_system_cmd_prefix = "/sbin/ntpdate ";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string ntp_system_cmd;
|
std::string ntp_system_cmd;
|
||||||
std::string ntpserver;
|
std::string ntpserver;
|
||||||
@@ -2113,9 +2109,12 @@ bool CEitManager::Start()
|
|||||||
oldEventsAre = config.epg_old_events*60L*60L; //hours
|
oldEventsAre = config.epg_old_events*60L*60L; //hours
|
||||||
max_events = config.epg_max_events;
|
max_events = config.epg_max_events;
|
||||||
|
|
||||||
|
if (access("/sbin/ntpdate", F_OK))
|
||||||
|
ntp_system_cmd_prefix = "/sbin/ntpd -q -p ";
|
||||||
|
|
||||||
printf("[sectionsd] Caching: %d days, %d hours Extended Text, max %d events, Events are old %d hours after end time\n",
|
printf("[sectionsd] Caching: %d days, %d hours Extended Text, max %d events, Events are old %d hours after end time\n",
|
||||||
config.epg_cache, config.epg_extendedcache, config.epg_max_events, config.epg_old_events);
|
config.epg_cache, config.epg_extendedcache, config.epg_max_events, config.epg_old_events);
|
||||||
printf("[sectionsd] NTP: %s, server %s\n", ntpenable ? "enabled" : "disabled", ntpserver.c_str());
|
printf("[sectionsd] NTP: %s, server %s, command %s\n", ntpenable ? "enabled" : "disabled", ntpserver.c_str(), ntp_system_cmd_prefix.c_str());
|
||||||
|
|
||||||
if (!sectionsd_server.prepare(SECTIONSD_UDS_NAME)) {
|
if (!sectionsd_server.prepare(SECTIONSD_UDS_NAME)) {
|
||||||
fprintf(stderr, "[sectionsd] failed to prepare basic server\n");
|
fprintf(stderr, "[sectionsd] failed to prepare basic server\n");
|
||||||
|
Reference in New Issue
Block a user