Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Generate log directory, if it does not exist #403

Merged

Conversation

panda-sheep
Copy link
Contributor

@panda-sheep panda-sheep commented Mar 22, 2021

As title

When we start the service with the following script, the log directory will be created in the script.
./scripts/nebula.service -c xxx/etc/nebula-storaged.conf start storaged> /dev/null 2>&1 &

But when we start the service in other ways, because the directory log does not exist, the startup fails.
xxx/bin/nebula-storaged --flagfile xxx/etc/nebula-storaged-1.conf >1.log 2 >&1 &

Therefore, before starting the service, the log directory needs to be created automatically when it does not exist.

@whitewum
Copy link
Contributor

what...

@critical27
Copy link
Contributor

I am not pretty sure if we should do it here. Usually we don't start cluster by --flagfile except some cases we don't use the scripts. Maybe do it in chaos?

@panda-sheep
Copy link
Contributor Author

I am not pretty sure if we should do it here. Usually we don't start cluster by --flagfile except some cases we don't use the scripts. Maybe do it in chaos?

Yeah, chaos uses this method.
The service fails to start because the log directory cannot be created.

@panda-sheep
Copy link
Contributor Author

In fact, I have always been confused.
why create the log directory in the script when starting the service with the script?
Wouldn't it be better to create the log directory by itself when starting the service program?

@critical27
Copy link
Contributor

In fact, I have always been confused.
why create the log directory in the script when starting the service with the script?
Wouldn't it be better to create the log directory by itself when starting the service program?

Yeah, if we create log_dir in program instead of scripts, I think it is ok, just add to graph as well.

@panda-sheep
Copy link
Contributor Author

panda-sheep commented Mar 25, 2021

In fact, I have always been confused.
why create the log directory in the script when starting the service with the script?
Wouldn't it be better to create the log directory by itself when starting the service program?

Yeah, if we create log_dir in program instead of scripts, I think it is ok, just add to graph as well.

Agree

Copy link
Contributor

@liuyu85cn liuyu85cn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good jooooob

@bright-starry-sky bright-starry-sky merged commit b472166 into vesoft-inc:master Mar 25, 2021
@panda-sheep panda-sheep deleted the gen_log_dir_if_absent branch March 25, 2021 06:43
jude-zhu pushed a commit that referenced this pull request Apr 1, 2021
* Generate log directory, if it does not exist

* update conf

(cherry picked from commit b472166)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants