解决方法
除了服务在受控环境中运行脚本之外,它们执行相同的操作.从
service(8) man page:
DESCRIPTION
service runs a System V init script in as predictable environment
as possible,removing most environment variables and with current
working directory set to/
.ENVIRONMENT
LANG
,TERM
The only environment variables passed to the init scripts.