diff options
author | Natanael Copa <natanael.copa@gmail.com> | 2008-01-11 09:56:09 +0000 |
---|---|---|
committer | Natanael Copa <natanael.copa@gmail.com> | 2008-01-11 09:56:09 +0000 |
commit | 246700bd368f97903675cb0b8e0354e863da41a3 (patch) | |
tree | 886460aae33a9e9429e5e448583712f5cf645d87 | |
parent | 68ee7652f9a567b75f49383b45496e85044daaba (diff) | |
download | acf-alpine-baselayout-246700bd368f97903675cb0b8e0354e863da41a3.tar.bz2 acf-alpine-baselayout-246700bd368f97903675cb0b8e0354e863da41a3.tar.xz |
use procps.pidof
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@551 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | syslog-model.lua | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/syslog-model.lua b/syslog-model.lua index 2ec8b3b..88700e2 100644 --- a/syslog-model.lua +++ b/syslog-model.lua @@ -2,6 +2,7 @@ module(..., package.seeall) require("fs") require("posix") +require("procps") local function get_version() local cmd = "/sbin/apk_version -v -s busybox | cut -d ' ' -f 1" @@ -13,11 +14,7 @@ end local is_running = function( process ) local statusreport = nil - local cmdoutput = {} - local cmd, error = io.popen("pidof " .. process ,r) - local cmdoutput = string.gsub(cmd:read("*a"), "%s", "") - cmd:close() - if (cmdoutput ~= "") then + if procps.pidof(process) then statusreport = "Yes" end return statusreport |