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
This commit is contained in:
Max 2022-09-09 21:02:15 +07:00 committed by msuraev
parent 2201900f94
commit 9b7a48421c
3 changed files with 0 additions and 23 deletions

View File

@ -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
|===

View File

@ -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

View File

@ -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) {