Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
123df2e5
Commit
123df2e5
authored
16 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Repaired init script status command.
parent
343c96cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
TODO
+2
-4
2 additions, 4 deletions
TODO
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
script/init.d/Makefile.am
+3
-1
3 additions, 1 deletion
script/init.d/Makefile.am
script/init.d/ethercat.in
+39
-27
39 additions, 27 deletions
script/init.d/ethercat.in
with
45 additions
and
32 deletions
TODO
+
2
−
4
View file @
123df2e5
...
...
@@ -8,8 +8,6 @@ $Id$
Version 1.4.0:
* Abort code messages in userspace.
* Repair rcethercat status.
* Attach Pdo names from SII or Coe dictionary to Pdos read via CoE.
* Update documentation.
* Check for possible race condition in jiffy-based frame timeout calculation.
...
...
@@ -17,10 +15,10 @@ Version 1.4.0:
Future issues:
* Distributed clocks.
*
Allow master requesting when in ORPHANED phase
*
Implement user space realtime interface via cdev.
* Move master threads, slave handlers and state machines into a user
space daemon.
*
Implement user space realtime interface via cdev.
*
Allow master requesting when in ORPHANED phase
* Mailbox protocol handlers.
* Mailbox state machine using toggle bits.
* Mailbox gateway.
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
0
View file @
123df2e5
...
...
@@ -503,6 +503,7 @@ AC_CONFIG_FILES([
master/Makefile
script/Makefile
script/init.d/Makefile
script/init.d/ethercat
script/sysconfig/Makefile
tool/Makefile
])
...
...
This diff is collapsed.
Click to expand it.
script/init.d/Makefile.am
+
3
−
1
View file @
123df2e5
...
...
@@ -35,6 +35,8 @@ initdir = $(sysconfdir)/init.d
init_SCRIPTS
=
ethercat
EXTRA_DIST
=
ethercat
EXTRA_DIST
=
ethercat.in
BUILT_SOURCES
=
ethercat
#------------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
script/init.d/ethercat
→
script/init.d/ethercat
.in
+
39
−
27
View file @
123df2e5
...
...
@@ -43,8 +43,8 @@
# Should-Stop: $time ntp
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: EtherCAT
M
aster
# Description:
# Short-Description: EtherCAT
m
aster
# Description:
EtherCAT master @VERSION@
### END INIT INFO
#------------------------------------------------------------------------------
...
...
@@ -52,6 +52,7 @@
MODPROBE
=
/sbin/modprobe
RMMOD
=
/sbin/rmmod
MODINFO
=
/sbin/modinfo
ETHERCAT
=
@prefix@/bin/ethercat
#------------------------------------------------------------------------------
...
...
@@ -84,43 +85,39 @@ function exit_success()
#------------------------------------------------------------------------------
function
exit_
running
()
function
exit_
fail
()
{
if
[
-r
/etc/rc.status
]
;
then
rc_
reset
rc_
failed
rc_status
-v
rc_exit
else
echo
"
running
"
exit
0
echo
"
failed
"
exit
1
fi
}
#------------------------------------------------------------------------------
function
exit_fail
()
function
print_running
()
{
if
[
-r
/etc/rc.status
]
;
then
rc_
failed
rc_
reset
rc_status
-v
rc_exit
else
echo
" failed"
exit
1
echo
" running"
fi
}
#------------------------------------------------------------------------------
function
exi
t_dead
()
function
prin
t_dead
()
{
if
[
-r
/etc/rc.status
]
;
then
rc_failed
rc_status
-v
rc_exit
else
echo
" dead"
exit
1
fi
}
...
...
@@ -148,7 +145,7 @@ fi
case
"
${
1
}
"
in
start
)
echo
-n
"Starting EtherCAT master "
echo
-n
"Starting EtherCAT master
@VERSION@
"
# construct DEVICES and BACKUPS from configuration variables
DEVICES
=
""
...
...
@@ -200,7 +197,7 @@ start)
;;
stop
)
echo
-n
"Shutting down EtherCAT master "
echo
-n
"Shutting down EtherCAT master
@VERSION@
"
# unload EtherCAT device modules
for
MODULE
in
${
DEVICE_MODULES
}
master
;
do
...
...
@@ -232,20 +229,35 @@ restart)
;;
status
)
echo
-n
"Checking for EtherCAT "
echo
"Checking for EtherCAT master @VERSION@"
# count masters in configuration file
MASTER_COUNT
=
0
while
true
;
do
DEVICE
=
$(
eval echo
"
\$
{MASTER
${
MASTER_COUNT
}
_DEVICE}"
)
if
[
-z
"
${
DEVICE
}
"
]
;
then
break
;
fi
MASTER_COUNT
=
$(
expr
${
MASTER_COUNT
}
+ 1
)
done
lsmod |
grep
-q
"^ec_master "
MASTERS_RUNNING
=
$?
RESULT
=
0
!
grep
-q
"(WAITING)"
/sys/ethercat/master
*
/info
MASTERS_IDLE
=
$?
for
i
in
`
seq
0
$(
expr
${
MASTER_COUNT
}
- 1
)
`
;
do
echo
-n
"Master
${
i
}
"
# Check if the master is in idle or operation phase
${
ETHERCAT
}
master
--master
${
i
}
2>/dev/null |
\
grep
-qE
'Phase:[[:space:]]*Idle|Phase:[[:space:]]*Operation'
EXITCODE
=
$?
if
[
${
EXITCODE
}
-eq
0
]
;
then
print_running
else
print_dead
RESULT
=
1
fi
done
# master module loaded and masters not waiting for devices?
if
[
${
MASTERS_RUNNING
}
-eq
0
-a
${
MASTERS_IDLE
}
-eq
0
]
;
then
exit_running
else
exit_dead
fi
exit
${
RESULT
}
;;
*
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment