From 5e5c72be38dd37fabe4ab2eab87fa77fd26f2371 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 17 Apr 2014 14:21:50 +0200 Subject: support symlinked RC scripts from PBI packages --- etc/inc/service-utils.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 59bd7ec..f137160 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -50,7 +50,7 @@ function write_rcfile($params) { global $g; $rcfile_fullname = RCFILEPREFIX . $params['file']; - if (!file_exists($rcfile_fullname) && !touch($rcfile_fullname)) + if (!file_exists($rcfile_fullname) && !is_link($rcfile_fullname) && !touch($rcfile_fullname)) return false; if (!is_writable($rcfile_fullname) || empty($params['start'])) @@ -100,7 +100,7 @@ function start_service($name) { if (!empty($service['prefix'])) { $prefix =& $service['prefix']; } - if(file_exists("{$prefix}{$service['rcfile']}")) { + if(file_exists("{$prefix}{$service['rcfile']}") || is_link("{$prefix}{$service['rcfile']}")) { mwexec_bg("{$prefix}{$service['rcfile']} start"); } } @@ -126,7 +126,7 @@ function stop_service($name) { if(!empty($service['prefix'])) { $prefix =& $service['prefix']; } - if(file_exists("{$prefix}{$service['rcfile']}")) { + if(file_exists("{$prefix}{$service['rcfile']}") || is_link("{$prefix}{$service['rcfile']}")) { mwexec("{$prefix}{$service['rcfile']} stop"); } return; -- cgit v1.1