Project

General

Profile

« Previous | Next » 

Revision c8960970

Added by Ermal LUÇI almost 15 years ago

Fix ntpd starting at boot time and also status->services checking/stop/start/restart display. Previously ntpd would not start at all either though it should.

View differences:

etc/inc/system.inc
1112 1112
function system_ntp_configure() {
1113 1113
	global $config, $g;
1114 1114

  
1115
	$syscfg = $config['system'];
1115
	$syscfg =& $config['system'];
1116 1116

  
1117 1117
	/* open configuration for wrting or bail */
1118 1118
	$fd = fopen("{$g['varetc_path']}/ntpd.conf","w");
......
1152 1152

  
1153 1153
	/* if openntpd is running, kill it */
1154 1154
	while(is_process_running("ntpd")) {
1155
		mwexec("/usr/bin/killall ntpd", true);
1155
		killbyname("ntpd");
1156 1156
	}
1157 1157

  
1158 1158
	/* if /var/empty does not exist, create it */
1159 1159
	if(!is_dir("/var/empty"))
1160 1160
		exec("/bin/mkdir -p /var/empty && chmod ug+rw /var/empty/.");
1161 1161

  
1162
	if($g['booting'])
1163
		return;
1164
	
1165 1162
	/* start opentpd, set time now and use /var/etc/ntpd.conf */
1166 1163
	exec("/usr/local/sbin/ntpd -s -f {$g['varetc_path']}/ntpd.conf");
1167 1164
	
usr/local/www/status_services.php
66 66
			captiveportal_init_webgui();
67 67
			break;
68 68
		case 'ntpd':
69
		case 'openntpd':
69 70
			system_ntp_configure();
70 71
			break;
71 72
		case 'bsnmpd':
......
113 114
			captiveportal_init_webgui();
114 115
			break;
115 116
		case 'ntpd':
117
		case 'openntpd':
116 118
			system_ntp_configure();
117 119
			break;		
118 120
		case 'bsnmpd':
......
160 162
		case 'ntpd':
161 163
			killbyname("ntpd");
162 164
			break;		
165
		case 'openntpd':
166
			killbyname("openntpd");
167
			break;
163 168
		case 'bsnmpd':
164 169
			killbypid("{$g['varrun_path']}/snmpd.pid");
165 170
			break;
......
181 186
		case 'miniupnpd':
182 187
			upnp_action('stop');
183 188
			break;
184
		case 'openntpd':
185
			killbyname("openntpd");
186
			break;
187 189
		case 'sshd':
188 190
			killbyname("sshd");
189 191
			break;
......
323 325

  
324 326
foreach (array('server', 'client') as $mode) {
325 327
	if (is_array($config['openvpn']["openvpn-{$mode}"])) {
326
		foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $settings) {
327
			$setting =& $config['openvpn']["openvpn-{$mode}"][$id];
328
		foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) {
328 329
			if (!isset($setting['disable'])) {
329 330
				$pconfig = array();
330 331
				$pconfig['name'] = "openvpn";

Also available in: Unified diff