msuraev has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bts/+/29303 )
Change subject: Don't manually create pid file
......................................................................
Don't manually create pid file
Previously osmo-bts created /var/run/osmo-bts.pid which
isn't used by anything and makes it hard to run as non-root
user. Let's get rid of this pre-systemd relic.
Related: OS#4107
Change-Id: I86bcaedbc8cb1297476ad741eaa45585fea3c380
---
M doc/manuals/chapters/architecture.adoc
M doc/startup.txt
M src/common/main.c
3 files changed, 0 insertions(+), 23 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/doc/manuals/chapters/architecture.adoc
b/doc/manuals/chapters/architecture.adoc
index 30eab7a..128ed59 100644
--- a/doc/manuals/chapters/architecture.adoc
+++ b/doc/manuals/chapters/architecture.adoc
@@ -89,7 +89,6 @@
| common | phy_links_open() | Iterate over list of configured PHY links
| bts-specific | bts_model_phy_link_open() | Open each of the configured PHY links
| bts-specific | bts_model_phy_link_close() | Close each of the configured PHY links
-| common | write_pid_file() | Generate the pid file
| common | osmo_daemonize() | Fork as daemon in background (if configured)
| common | bts_main() | Run main loop until global variable quit >= 2
|===
diff --git a/doc/startup.txt b/doc/startup.txt
index c60cc0a..816e76b 100644
--- a/doc/startup.txt
+++ b/doc/startup.txt
@@ -27,7 +27,6 @@
| common | abis_open() | Start of the A-bis connection to BSC
| common | phy_links_open() | Iterate over list of configured PHY links
| bts-specific | bts_model_phy_link_open() | Open each of the configured PHY links
-| common | write_pid_file() | Generate the pid file
| common | osmo_daemonize() | Fork as daemon in background (if configured)
| common | bts_main() | Run main loop until global variable quit >= 2
| bts-specific | bts_model_oml_estab() | Called by core once OML link is established
diff --git a/src/common/main.c b/src/common/main.c
index d069812..954cc34 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -257,25 +257,6 @@
}
}
-static int write_pid_file(char *procname)
-{
- FILE *outf;
- char tmp[PATH_MAX+1];
-
- snprintf(tmp, sizeof(tmp)-1, "/var/run/%s.pid", procname);
- tmp[PATH_MAX-1] = '\0';
-
- outf = fopen(tmp, "w");
- if (!outf)
- return -1;
-
- fprintf(outf, "%d\n", getpid());
-
- fclose(outf);
-
- return 0;
-}
-
int bts_main(int argc, char **argv)
{
struct gsm_bts_trx *trx;
@@ -358,8 +339,6 @@
}
}
- write_pid_file("osmo-bts");
-
/* Accept a GSMTAP host from VTY config, but a commandline option overrides that. */
if (gsmtap_ip != NULL) {
if (g_bts->gsmtap.remote_host != NULL) {
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/29303
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I86bcaedbc8cb1297476ad741eaa45585fea3c380
Gerrit-Change-Number: 29303
Gerrit-PatchSet: 2
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged