Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174242461
D56533.id175920.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D56533.id175920.diff
View Options
diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc
--- a/usr.sbin/ctld/ctld.cc
+++ b/usr.sbin/ctld/ctld.cc
@@ -1962,22 +1962,14 @@
log_init(conf_debug);
}
- /*
- * Rename the pidfile if the pathname changes. On startup,
- * oldconf created via conf_new_from_kernel will not contain a
- * valid pidfile_path.
- */
- if (!oldconf->conf_pidfile_path.empty()) {
- if (oldconf->conf_pidfile_path != conf_pidfile_path) {
- /* pidfile has changed. rename it */
- log_debugx("moving pidfile to %s",
+ /* Rename the pidfile if the pathname changes. */
+ if (oldconf->conf_pidfile_path != conf_pidfile_path) {
+ log_debugx("moving pidfile to %s", conf_pidfile_path.c_str());
+ if (rename(oldconf->conf_pidfile_path.c_str(),
+ conf_pidfile_path.c_str()) != 0) {
+ log_err(1, "renaming pidfile %s -> %s",
+ oldconf->conf_pidfile_path.c_str(),
conf_pidfile_path.c_str());
- if (rename(oldconf->conf_pidfile_path.c_str(),
- conf_pidfile_path.c_str()) != 0) {
- log_err(1, "renaming pidfile %s -> %s",
- oldconf->conf_pidfile_path.c_str(),
- conf_pidfile_path.c_str());
- }
}
}
@@ -2753,6 +2745,9 @@
newconf->set_debug(debug);
}
+ /* Reuse the pidfile path from the configuration file. */
+ oldconf->set_pidfile_path(newconf->pidfile_path());
+
if (!newconf->add_pports(kports))
log_errx(1, "Error associating physical ports; exiting");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 2, 4:05 PM (16 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40089201
Default Alt Text
D56533.id175920.diff (1 KB)
Attached To
Mode
D56533: ctld: Simplify pidfile rename handling in conf::apply
Attached
Detach File
Event Timeline
Log In to Comment