aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2022-09-09 21:02:15 +0700
committermsuraev <msuraev@sysmocom.de>2022-09-14 08:30:11 +0000
commit9b7a48421c84c3d055af8bd680ebbe24f87ee8b2 (patch)
tree3726f2f29b95434cd5beec89670f43c84e5bceb2
parent2201900f949e90ab0583adea36ce45e95d2f547d (diff)
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
-rw-r--r--doc/manuals/chapters/architecture.adoc1
-rw-r--r--doc/startup.txt1
-rw-r--r--src/common/main.c21
3 files changed, 0 insertions, 23 deletions
diff --git a/doc/manuals/chapters/architecture.adoc b/doc/manuals/chapters/architecture.adoc
index 30eab7a4..128ed597 100644
--- a/doc/manuals/chapters/architecture.adoc
+++ b/doc/manuals/chapters/architecture.adoc
@@ -89,7 +89,6 @@ order to specify which PHY instance is allocated to this specific TRX.
| 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 c60cc0a7..816e76bf 100644
--- a/doc/startup.txt
+++ b/doc/startup.txt
@@ -27,7 +27,6 @@ The start-up procedure of OsmoBTS can be described as follows:
| 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 d0698125..954cc34c 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -257,25 +257,6 @@ static void signal_handler(int signum)
}
}
-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 @@ int bts_main(int argc, char **argv)
}
}
- 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) {