Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broker can't restart with log file on Windows #1080

Closed
lcouz opened this issue Dec 13, 2018 · 2 comments
Closed

Broker can't restart with log file on Windows #1080

lcouz opened this issue Dec 13, 2018 · 2 comments

Comments

@lcouz
Copy link

lcouz commented Dec 13, 2018

Hello,
Running on Windows (in service mode) with logging configuration to file : "log_dest file ..." in configuration file, when stop the service, the service can't restart.
By reading the code, in util_mosq.c l.422, "CreateFile" function is called with "CREATE_NEW" parameter.
In cas of an existinf log fille, INVALID_HANDLE_VALUE is returned , this case is not tested in code.
I suggest to use "CREATE_ALWAYS" parameter instead.

Not tested, but problem is probably also present in "application" mode.

@big-col
Copy link

big-col commented Dec 31, 2018

I have the same issue, deleting the current log file enables the mosquitto service to start

lcouz added a commit to lcouz/mosquitto that referenced this issue Jan 7, 2019
Fix proposal for : Broker can't restart with log file on Windows eclipse#1080
@lcouz lcouz mentioned this issue Jan 7, 2019
6 tasks
@ralight
Copy link
Contributor

ralight commented Feb 3, 2019

I've made a change that handles this case for reading an existing file, creating a new file or appending to an existing file. It will be in 1.5.6 soon.

@ralight ralight closed this as completed Feb 3, 2019
ralight added a commit that referenced this issue Feb 8, 2019
ralight added a commit that referenced this issue Apr 25, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants