mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
OpenWRT: Try to create dir for pidfile
This commit is contained in:
parent
8ea9783de7
commit
a19c0fa121
2 changed files with 11 additions and 1 deletions
|
@ -15,7 +15,7 @@ http_server {
|
||||||
}
|
}
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
hls {
|
hls {
|
||||||
enabled on;
|
enabled off;
|
||||||
}
|
}
|
||||||
http_remux {
|
http_remux {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -744,12 +744,22 @@ srs_error_t SrsServer::initialize_signal()
|
||||||
|
|
||||||
srs_error_t SrsServer::acquire_pid_file()
|
srs_error_t SrsServer::acquire_pid_file()
|
||||||
{
|
{
|
||||||
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
// when srs in dolphin mode, no need the pid file.
|
// when srs in dolphin mode, no need the pid file.
|
||||||
if (_srs_config->is_dolphin()) {
|
if (_srs_config->is_dolphin()) {
|
||||||
return srs_success;
|
return srs_success;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string pid_file = _srs_config->get_pid_file();
|
std::string pid_file = _srs_config->get_pid_file();
|
||||||
|
|
||||||
|
// Try to create dir for pid file.
|
||||||
|
string pid_dir = srs_path_dirname(pid_file);
|
||||||
|
if (!srs_path_exists(pid_dir)) {
|
||||||
|
if ((err = srs_create_dir_recursively(pid_dir)) != srs_success) {
|
||||||
|
return srs_error_wrap(err, "create %s", pid_dir.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// -rw-r--r--
|
// -rw-r--r--
|
||||||
// 644
|
// 644
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue