Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IBMiOS/400QSH-shell脚本_Shell_Startup_Tivoli - Fatal编程技术网

IBMiOS/400QSH-shell脚本

IBMiOS/400QSH-shell脚本,shell,startup,tivoli,Shell,Startup,Tivoli,我已经为Tivoli Workload Scheduler提供了一个启动/停止脚本,在该脚本中,它将启动/stp[IBM I中的TWS服务] # CHECK ROOT USER WHO=`id | cut -f1 -d" "` if [ "$WHO" = "uid=0(root)" ] then su TWSSVC -c "/etc/rc.d/init.d/tebctl-tws_cpa_agent_TWSSVC stop" exit $?

我已经为Tivoli Workload Scheduler提供了一个启动/停止脚本,在该脚本中,它将启动/stp[IBM I中的TWS服务]

    # CHECK ROOT USER
    WHO=`id | cut -f1 -d" "`
    if [ "$WHO" = "uid=0(root)" ]
    then
    su TWSSVC -c "/etc/rc.d/init.d/tebctl-tws_cpa_agent_TWSSVC stop"
    exit $?
    fi

    /etc/rc.d/init.d/tebctl-tws_cpa_agent_TWSSVC stop
    exit $?
问题是,在OS/400中,根的等价物是QSECOFR,所以我修改了这一行

 if [ "$WHO" = "uid=0(root)" ]

然后我在下面的行中得到一个错误:

 su TWSSVC -c "/etc/rc.d/init.d/tebctl-tws_cpa_agent_TWSSVC stop"

 /TWSSVC/TWS/ShutDownLwa: 001-0019 Error found searching for command su. No such path or directory.   

如何更改为脚本,以便当它是QSECOFR时,它将su转换为TWSSVC并触发启动/停止脚本?我不太熟悉OS400。我正在qsh环境中触发此脚本。

您可以尝试以下操作:

sudo TWSSVC -c "/etc/rc.d/init.d/tebctl-tws_cpa_agent_TWSSVC stop"

告诉我是怎么回事。

Hi nu1silva,/TWSSVC/TWS/ShutDownLwa:001-0019搜索命令sudo时发现错误。没有这样的路径或目录。你在什么环境下?Ubuntu/CentOS/RHEL?终端中的su或sudo工作正常吗?Hi nu1silva,这是一台运行OS/400的IBM i机器,我在Qshell中运行了命令。对不起,我的坏消息没有读到主题正确。无论如何,这与使用su/sudo的Unix/Linux完全不同。您可能必须切换到具有权限的用户。请查看此项和此项。希望有帮助
sudo TWSSVC -c "/etc/rc.d/init.d/tebctl-tws_cpa_agent_TWSSVC stop"