Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
84
Issues
84
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
6d931c7e
Commit
6d931c7e
authored
Jul 03, 2015
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(no technical) replace all occurrences of deamon with daemon
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
59e08897
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
37 deletions
+37
-37
stop-mb.sh
userspace/rootfs_override/wr/sbin/stop-mb.sh
+1
-1
WR-SWITCH-MIB.txt
userspace/snmpd/WR-SWITCH-MIB.txt
+10
-10
wrsBootStatusGroup.c
userspace/snmpd/wrsBootStatusGroup.c
+22
-22
wrsOSStatusGroup.c
userspace/snmpd/wrsOSStatusGroup.c
+1
-1
hal_main.c
userspace/wrsw_hal/hal_main.c
+3
-3
No files found.
userspace/rootfs_override/wr/sbin/stop-mb.sh
View file @
6d931c7e
#!/bin/ash
export
WR_HOME
=
"/wr"
echo
"Killing d
ea
mon"
echo
"Killing d
ae
mon"
killall wrsw_hal
killall wrsw_rtud
killall ptpd
...
...
userspace/snmpd/WR-SWITCH-MIB.txt
View file @
6d931c7e
...
...
@@ -696,9 +696,9 @@ wrsBootUserspaceDaemonsMissing OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Checking if all desired d
ea
mons are running.
allDeamonsPresent - all d
ea
mons running
other numbers represent number of d
ea
mons not running
"Checking if all desired d
ae
mons are running.
allDeamonsPresent - all d
ae
mons running
other numbers represent number of d
ae
mons not running
other errors (can be: unable to run ps command or problem with multiple process instances)
are reported as maximum number of missing modules"
::= { wrsBootStatusGroup 14 }
...
...
@@ -925,7 +925,7 @@ wrsStartCntHAL OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of HAL d
ea
mon starts"
"Number of HAL d
ae
mon starts"
::= { wrsStartCntGroup 1 }
wrsStartCntPPSI OBJECT-TYPE
...
...
@@ -933,7 +933,7 @@ wrsStartCntPPSI OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of PPSI d
ea
mon starts"
"Number of PPSI d
ae
mon starts"
::= { wrsStartCntGroup 2 }
wrsStartCntRTUd OBJECT-TYPE
...
...
@@ -941,7 +941,7 @@ wrsStartCntRTUd OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of RTU d
ea
mon starts"
"Number of RTU d
ae
mon starts"
::= { wrsStartCntGroup 3 }
wrsStartCntSshd OBJECT-TYPE
...
...
@@ -949,7 +949,7 @@ wrsStartCntSshd OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Nmber of SSH d
ea
mon starts"
"Nmber of SSH d
ae
mon starts"
::= { wrsStartCntGroup 4 }
wrsStartCntHttpd OBJECT-TYPE
...
...
@@ -957,7 +957,7 @@ wrsStartCntHttpd OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Nmber of HTTP d
ea
mon starts"
"Nmber of HTTP d
ae
mon starts"
::= { wrsStartCntGroup 5 }
wrsStartCntSnmpd OBJECT-TYPE
...
...
@@ -965,7 +965,7 @@ wrsStartCntSnmpd OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Nmber of SNMP d
ea
mon starts"
"Nmber of SNMP d
ae
mon starts"
::= { wrsStartCntGroup 6 }
wrsStartCntSyslogd OBJECT-TYPE
...
...
@@ -973,7 +973,7 @@ wrsStartCntSyslogd OBJECT-TYPE
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Nmber of SYSLOG d
ea
mon starts"
"Nmber of SYSLOG d
ae
mon starts"
::= { wrsStartCntGroup 7 }
-- wrsSpllState (.7.3)
...
...
userspace/snmpd/wrsBootStatusGroup.c
View file @
6d931c7e
...
...
@@ -61,21 +61,21 @@ static struct wrs_km_item kernel_modules[] = {
[
6
]
=
{
"g_serial"
},
};
/* user space d
ea
mon list item */
/* user space d
ae
mon list item */
struct
wrs_usd_item
{
char
*
key
;
/* process name */
int32_t
exp
;
/* expected number of processes */
uint32_t
cnt
;
/* number of processes found */
};
/* user space d
ea
mon list */
/* user space d
ae
mon list */
/* - key contain process name reported by ps command
* - positive exp describe exact number of expected processes
* - negative exp describe minimum number of expected processes. Usefull for
* processes that is hard to predict number of their instances. For example
* new dropbear process is spawned at ssh login.
*/
static
struct
wrs_usd_item
userspace_d
ea
mons
[]
=
{
static
struct
wrs_usd_item
userspace_d
ae
mons
[]
=
{
[
0
]
=
{.
key
=
"/usr/sbin/dropbear"
,
.
exp
=
-
1
},
/* expect at least one
* dropbear process */
[
1
]
=
{
"/wr/bin/wrsw_hal"
,
2
},
/* two wrsw_hal instances */
...
...
@@ -381,8 +381,8 @@ static void get_loaded_kernel_modules_status(void)
fclose
(
f
);
}
/* check if d
eamons from userspace_dea
mons array are running */
static
void
get_d
ea
mons_status
(
void
)
/* check if d
aemons from userspace_dae
mons array are running */
static
void
get_d
ae
mons_status
(
void
)
{
FILE
*
f
;
char
key
[
41
];
/* 1 for null char */
...
...
@@ -391,9 +391,9 @@ static void get_deamons_status(void)
int
processes_wrong
=
0
;
/* number of too many or too few processes */
/* clear user space d
ea
mon counters */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
userspace_d
ea
mons
);
i
++
)
{
userspace_d
ea
mons
[
i
].
cnt
=
0
;
/* clear user space d
ae
mon counters */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
userspace_d
ae
mons
);
i
++
)
{
userspace_d
ae
mons
[
i
].
cnt
=
0
;
}
/* Use ps command to get process list, more portable, less error prone
...
...
@@ -405,11 +405,11 @@ static void get_deamons_status(void)
wrsBootStatus_s
.
wrsBootUserspaceDaemonsMissing
=
0
;
/* Notify snmp about error in processes list */
/* Count number of expected processes */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
userspace_d
ea
mons
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
userspace_d
ae
mons
);
i
++
)
{
/* when exp < 0 then expect at least number of
* -exp processes */
wrsBootStatus_s
.
wrsBootUserspaceDaemonsMissing
+=
abs
(
userspace_d
ea
mons
[
i
].
exp
);
abs
(
userspace_d
ae
mons
[
i
].
exp
);
}
return
;
...
...
@@ -423,31 +423,31 @@ static void get_deamons_status(void)
if
(
ret
!=
1
)
continue
;
/* error... or EOF */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
userspace_d
ea
mons
);
i
++
)
{
if
(
strncmp
(
key
,
userspace_d
ea
mons
[
i
].
key
,
40
))
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
userspace_d
ae
mons
);
i
++
)
{
if
(
strncmp
(
key
,
userspace_d
ae
mons
[
i
].
key
,
40
))
continue
;
userspace_d
ea
mons
[
i
].
cnt
++
;
userspace_d
ae
mons
[
i
].
cnt
++
;
break
;
}
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
userspace_d
ea
mons
);
i
++
)
{
if
(
userspace_d
ea
mons
[
i
].
exp
<
0
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
userspace_d
ae
mons
);
i
++
)
{
if
(
userspace_d
ae
mons
[
i
].
exp
<
0
)
{
/* if exp < 0 then expect at least -exp processes,
* useful in situation when we cannot predict exact
* number of processes.
* NOTE: exp in this case is negative number */
/* saturate cnt */
if
(
userspace_d
eamons
[
i
].
cnt
>
(
-
userspace_dea
mons
[
i
].
exp
))
{
userspace_d
ea
mons
[
i
].
cnt
=
(
-
userspace_d
ea
mons
[
i
].
exp
);
if
(
userspace_d
aemons
[
i
].
cnt
>
(
-
userspace_dae
mons
[
i
].
exp
))
{
userspace_d
ae
mons
[
i
].
cnt
=
(
-
userspace_d
ae
mons
[
i
].
exp
);
}
}
/* Calculate delta between expected and counted number
* of processes. Neither too much or too few are ok.
* NOTE: abs "exp" too */
processes_wrong
+=
abs
(
abs
(
userspace_d
ea
mons
[
i
].
exp
)
-
userspace_d
ea
mons
[
i
].
cnt
);
processes_wrong
+=
abs
(
abs
(
userspace_d
ae
mons
[
i
].
exp
)
-
userspace_d
ae
mons
[
i
].
cnt
);
}
/* save number of processes missing */
...
...
@@ -480,8 +480,8 @@ time_t wrsBootStatus_data_fill(void)
/* get loaded kernel modules */
get_loaded_kernel_modules_status
();
/* get info about running d
ea
mons */
get_d
ea
mons_status
();
/* get info about running d
ae
mons */
get_d
ae
mons_status
();
/* there was an update, return current time */
return
time_update
;
...
...
userspace/snmpd/wrsOSStatusGroup.c
View file @
6d931c7e
...
...
@@ -80,7 +80,7 @@ time_t wrsOSStatus_data_fill(void)
||
b
->
wrsBootLoadLM32
==
WRS_BOOT_LOAD_LM32_ERROR
||
b
->
wrsBootLoadLM32
==
WRS_BOOT_LOAD_LM32_FILE_NOT_FOUND
||
b
->
wrsBootKernelModulesMissing
>
0
/* contain number of missing modules */
||
b
->
wrsBootUserspaceDaemonsMissing
>
0
/* contain number of missing d
ea
mons */
||
b
->
wrsBootUserspaceDaemonsMissing
>
0
/* contain number of missing d
ae
mons */
)
{
wrsOSStatus_s
.
wrsBootSuccessful
=
WRS_BOOT_SUCCESSFUL_ERROR
;
...
...
userspace/wrsw_hal/hal_main.c
View file @
6d931c7e
...
...
@@ -69,7 +69,7 @@ static int hal_shutdown()
return
0
;
}
static
void
hal_d
ea
monize
();
static
void
hal_d
ae
monize
();
/* Main initialization function */
static
int
hal_init
()
...
...
@@ -105,13 +105,13 @@ static int hal_init()
shw_io_write
(
shw_io_led_state_g
,
1
);
if
(
daemon_mode
)
hal_d
ea
monize
();
hal_d
ae
monize
();
return
0
;
}
/* Turns a nice and well-behaving HAL into an evil servant of satan. */
static
void
hal_d
ea
monize
()
static
void
hal_d
ae
monize
()
{
pid_t
pid
,
sid
;
...
...
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