Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lockfile directory not existing error
Browse files Browse the repository at this point in the history
QU3B1M committed Jan 9, 2025
1 parent ce47038 commit dd1eefc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion distribution/packages/src/common/init.d/wazuh-indexer
Original file line number Diff line number Diff line change
@@ -96,6 +96,10 @@ start() {
if [ -n "$pidfile" ] && [ ! -e "$pidfile" ]; then
touch "$pidfile" && chown wazuh-indexer:wazuh-indexer "$pidfile"
fi
# Ensure that the lockfile directory exists
if [ ! -d "/var/lock/subsys/" ]; then
mkdir -p "/var/lock/subsys/"
fi

cd $OPENSEARCH_HOME || exit
echo -n $"Starting $prog..."
@@ -108,7 +112,9 @@ start() {
retval=$?
echo
if [ $retval -eq 0 ]; then
touch $lockfile > /dev/null 2>&1
if [ ! -f $lockfile ]; then
touch $lockfile > /dev/null 2>&1
fi
echo "$prog started successfully"
else
echo "Failed to start $prog"

0 comments on commit dd1eefc

Please sign in to comment.