关于 SequoiaDB
快速入门
安装
基本操作
数据模型
SQL引擎
S3引擎
系统架构
数据库管理
连接器
驱动
参考手册
故障排除
SAC 管控中心
Web服务
版本信息
System.runService( <servicename>, <command>, [option] )
System
运行service命令
| 参数名 | 参数类型 | 默认值 | 描述 | 是否必填 |
|---|---|---|---|---|
| servicename | string | --- | 服务名 | 是 |
| command | string | --- | 运行服务名对应的命令 | 是 |
| option | string | 空 | 运行命令的选项 | 否 |
返回运行service命令的信息
如果出错则抛异常,并输出错误信息,可以通过getLastErrMsg()获取错误信息或通过getLastError()获取错误码。 关于错误处理可以参考常见错误处理指南。
常见错误可参考错误码。
查看ssh服务信息
> System.runService( "ssh", "status", "" )
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since 三 2019-05-29 10:29:47 CST; 6 days ago
Main PID: 1637 (sshd)
Tasks: 1
Memory: 5.6M
CPU: 1.268s
CGroup: /system.slice/ssh.service
└─1637 /usr/sbin/sshd -D
6月 04 14:57:06 hostname sshd[24292]: pam_unix(sshd:session): session opened for user sdbadmin by (uid=0)
6月 04 15:12:22 hostname sshd[17900]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.10.124 user=username
展开