Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lede-mikrotik
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Johannes Rudolph
lede-mikrotik
Commits
a4571b76
Commit
a4571b76
authored
8 years ago
by
John Crispin
Committed by
Jo-Philipp Wich
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ubox: make logging code honour the hostname properly
Signed-off-by:
John Crispin
<
john@phrozen.org
>
parent
c3cf3c4e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/system/ubox/files/log.init
+4
-2
4 additions, 2 deletions
package/system/ubox/files/log.init
with
4 additions
and
2 deletions
package/system/ubox/files/log.init
+
4
−
2
View file @
a4571b76
...
...
@@ -14,6 +14,7 @@ validate_log_section()
uci_validate_section system system
"
${
1
}
"
\
'log_file:string'
\
'log_size:uinteger'
\
'log_hostname:string'
\
'log_ip:ipaddr'
\
'log_remote:bool:1'
\
'log_port:port:514'
\
...
...
@@ -64,7 +65,7 @@ start_service_remote()
{
PIDCOUNT
=
"
$((
${
PIDCOUNT
}
+
1
))
"
local
pid_file
=
"/var/run/logread.
${
PIDCOUNT
}
.pid"
local
log_ip log_port log_proto log_prefix log_remote log_trailer_null
local
log_ip log_port log_proto log_prefix log_remote log_trailer_null
log_hostname
validate_log_section
"
${
1
}
"
||
{
echo
"validation failed"
...
...
@@ -72,9 +73,10 @@ start_service_remote()
}
[
"
${
log_remote
}
"
-ne
0
]
||
return
[
-z
"
${
log_ip
}
"
]
&&
return
[
-z
"
${
log_hostname
}
"
]
&&
log_hostname
=
$(
cat
/proc/sys/kernel/hostname
)
procd_open_instance
procd_set_param
command
"
$PROG
"
-f
-r
"
$log_ip
"
"
${
log_port
}
"
-p
"
$pid_file
"
procd_set_param
command
"
$PROG
"
-f
-h
"
$log_hostname
"
-r
"
$log_ip
"
"
${
log_port
}
"
-p
"
$pid_file
"
case
"
${
log_proto
}
"
in
"udp"
)
procd_append_param
command
-u
;;
"tcp"
)
[
"
${
log_trailer_null
}
"
-eq
1
]
&&
procd_append_param
command
-0
;;
...
...
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