summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <natanael.copa@gmail.com>2008-01-11 10:00:15 +0000
committerNatanael Copa <natanael.copa@gmail.com>2008-01-11 10:00:15 +0000
commit00ee16959c032373d3c6bbad8ec5e0361ed9e03b (patch)
tree77fef72eec058248de0f5de9a6c5e44db1bed12d
parentd65a5dad8a44bc9395465efad4702fa5037b7a25 (diff)
downloadacf-dhcp-00ee16959c032373d3c6bbad8ec5e0361ed9e03b.tar.bz2
acf-dhcp-00ee16959c032373d3c6bbad8ec5e0361ed9e03b.tar.xz
use procps.pidof
git-svn-id: svn://svn.alpinelinux.org/acf/dhcp/trunk@552 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--dhcp-model.lua13
1 files changed, 2 insertions, 11 deletions
diff --git a/dhcp-model.lua b/dhcp-model.lua
index 858f3f0..04186f5 100644
--- a/dhcp-model.lua
+++ b/dhcp-model.lua
@@ -3,6 +3,7 @@
module (..., package.seeall)
--- get additional libraries
+require("procps")
require("validator")
local subnet = {}
@@ -762,17 +763,7 @@ read_file = function ( filename )
end
is_running = function( process )
- local retval = false
- local file = io.popen("pidof " .. process)
- if file ~= nil then
- local line = file:read( "*l" )
- file:close()
- if #line > 0 then
- retval = true
- end
- end
-
- return retval
+ return procps.pidof(process) ~= nil
end
get_dhcpd_version = function()