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
changes/03/29303/2
Maxim Suraev 3 months ago committed by msuraev
parent 2201900f94
commit 9b7a48421c
  1. 1
      doc/manuals/chapters/architecture.adoc
  2. 1
      doc/startup.txt
  3. 21
      src/common/main.c

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

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

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

Loading…
Cancel
Save