From 00ee16959c032373d3c6bbad8ec5e0361ed9e03b Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 11 Jan 2008 10:00:15 +0000 Subject: use procps.pidof git-svn-id: svn://svn.alpinelinux.org/acf/dhcp/trunk@552 ab2d0c66-481e-0410-8bed-d214d4d58bed --- dhcp-model.lua | 13 ++----------- 1 file 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() -- cgit v1.2.3