Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nurlan
eepm
Commits
74d9fb44
Commit
74d9fb44
authored
Aug 15, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv: some anyssh fixes
parent
c77dec4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
serv
bin/serv
+6
-2
serv-enable
bin/serv-enable
+1
-2
serv-status
bin/serv-status
+5
-3
No files found.
bin/serv
View file @
74d9fb44
...
@@ -104,6 +104,7 @@ ANYSYSDDIR="/lib/systemd/system"
...
@@ -104,6 +104,7 @@ ANYSYSDDIR="/lib/systemd/system"
}
}
# TODO: done it on anyservice part
is_anyservice
()
is_anyservice
()
{
{
local
SERVICE
=
"
$1
"
local
SERVICE
=
"
$1
"
...
@@ -111,8 +112,11 @@ is_anyservice()
...
@@ -111,8 +112,11 @@ is_anyservice()
[
-n
"
$ANYSERVICE
"
]
||
return
1
[
-n
"
$ANYSERVICE
"
]
||
return
1
# not, if there is regular service with the name
# not, if there is regular service with the name
[
-d
"
$INITDIR
/
$SERVICE
"
]
&&
return
1
[
-d
"
$INITDIR
/
$SERVICE
"
]
&&
return
1
# yes, if the service is anyservice driven
# yes, the service is anyservice driven
[
-r
"
$ANYSERVDIR
/
$SERVICE
.service"
]
[
-r
"
$ANYSERVDIR
/
$SERVICE
.service"
]
&&
return
0
# yes, the service can be anyservice driven
[
-r
"
$ANYSYSDDIR
/
$SERVICE
.service"
]
&&
return
0
return
1
}
}
...
...
bin/serv-enable
View file @
74d9fb44
...
@@ -29,8 +29,7 @@ __serv_enable()
...
@@ -29,8 +29,7 @@ __serv_enable()
case
$SERVICETYPE
in
case
$SERVICETYPE
in
service-chkconfig
)
service-chkconfig
)
# can't use is_anyservice here
if
is_anyservice
$SERVICE
;
then
if
[
!
-d
"
$INITDIR
/
$SERVICE
"
]
&&
[
-n
"
$ANYSERVICE
"
]
&&
[
-r
"
$ANYSYSDDIR
/
$SERVICE
.service"
]
;
then
sudocmd anyservice
$SERVICE
on
sudocmd anyservice
$SERVICE
on
return
return
fi
fi
...
...
bin/serv-status
View file @
74d9fb44
...
@@ -49,10 +49,12 @@ is_service_autostart()
...
@@ -49,10 +49,12 @@ is_service_autostart()
case
$SERVICETYPE
in
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
service-chkconfig|service-upstart
)
if
is_anyservice
$1
;
then
if
is_anyservice
$1
;
then
# if is registered, assume it is autostarted
# HACK: if is registered, assume it is autostarted
return
0
[
-r
"
$ANYSERVDIR
/
$SERVICE
.service"
]
return
fi
fi
# FIXME: check for current runlevel
# FIXME: check for current runlevel
LANG
=
C
$SUDO
chkconfig
$1
--list
|
grep
-q
"[35]:on"
LANG
=
C
$SUDO
chkconfig
$1
--list
|
grep
-q
"[35]:on"
;;
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment