免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1742 | 回复: 8

[系统管理] 使用service命令,遇见一个奇怪的错误 [复制链接]

论坛徽章:
0
发表于 2013-02-22 15:03 |显示全部楼层
service crond restart

bash: line 1: syntax error near unexpected token `('
'ash: line 1: `220 evermail.ca ESMTP Postfix (Debian/GNU)
bash: line 1: syntax error near unexpected token `('
'ash: line 1: `220 evermail.ca ESMTP Postfix (Debian/GNU)

论坛徽章:
0
发表于 2013-02-22 15:05 |显示全部楼层
[root@localhost bin]# service crond restart
Stopping crond:                                            [  OK  ]
Starting crond:                                            [  OK  ]
[root@localhost bin]# bash: line 1: syntax error near unexpected token `('
'ash: line 1: `220 evermail.ca ESMTP Postfix (Debian/GNU)
bash: line 1: syntax error near unexpected token `('
'ash: line 1: `220 evermail.ca ESMTP Postfix (Debian/GNU)


[root@localhost bin]# ps -ef |grep crond
root      2136     1  0 15:04 ?        00:00:00 crond

论坛徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亚冠之浦和红钻
日期:2015-06-23 19:10:532015亚冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16赛季CBA联赛之山东
日期:2016-01-31 18:25:0515-16赛季CBA联赛之四川
日期:2016-02-16 16:08:30程序设计版块每日发帖之星
日期:2016-06-29 06:20:002017金鸡报晓
日期:2017-01-10 15:19:5615-16赛季CBA联赛之佛山
日期:2017-02-27 20:41:19
发表于 2013-02-22 15:06 |显示全部楼层
缺省shell不支持脚本的语法,用bash2以上版本试试

论坛徽章:
0
发表于 2013-02-22 15:07 |显示全部楼层
[root@localhost bin]# bash -version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

论坛徽章:
0
发表于 2013-02-22 15:09 |显示全部楼层
[root@localhost bin]# ll sh
lrwxrwxrwx. 1 root root 4 Dec 14 17:32 sh -> bash

论坛徽章:
0
发表于 2013-02-22 15:25 |显示全部楼层
[root@localhost bin]# echo $SHELL
/bin/bash

论坛徽章:
3
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:51:162015年亚洲杯之阿曼
日期:2015-04-07 20:00:59
发表于 2013-02-22 16:59 |显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
发表于 2013-02-22 17:41 |显示全部楼层
service命令,没错呀!用service 命令重启/etc/init.d/目录下的任何一个文件,都报这个错误。

论坛徽章:
0
发表于 2013-02-26 17:00 |显示全部楼层
#rpm -V initscripts

看看有没有东西被改过
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP