Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7840865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:56:52+00:00 2026-06-02T15:56:52+00:00

Is there any possibility to perform graceful restart and check apache config syntax without

  • 0

Is there any possibility to perform graceful restart and check apache config syntax without being root or having root privileges?

I have already tried to set suid bit to the script which performs restart. Here is the script itself:

#!/bin/bash

FILENAME=$1
DATE=`date +%Y%m%d`
DIRECTORY='bckp/'
if [ ! -d "$DIRECTORY" ]; then
    echo "Backup directory doesn't exist. Creating one."
    mkdir $DIRECTORY
fi

if [ -z "$FILENAME" -a ! -f "$FILENAME" ]; then
    FILENAME="webdav.conf"
    echo "No file specified. Backing up webdav.conf"
fi

REV=0
BACKUP="$FILENAME.$DATE.$REV"

while [ -f $BACKUP ]; do
    let REV+=1
    BACKUP="$DIRECTORY$FILENAME.$DATE.$REV"
done

cp $FILENAME $BACKUP

echo $OUTPUT
OUTPUT=$(apache2ctl configtest 2>&1)
if [ "$OUTPUT" == "Syntax OK" ]; then
    echo "Syntax OK"
    echo "Performing restart"
    apachectl -k graceful 2>&1
fi

exit $?

here is the ls -l for this file:

-rwsrwxr-x 1 root user  645 2012-04-26 18:05 graceful-restart

When i try to run this script i get the following output:

No file specified. Backing up webdav.conf
ulimit: 88: error setting limit (Operation not permitted) Syntax OK

I’m interested if it is possible to perform what i’ve described.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:56:56+00:00Added an answer on June 2, 2026 at 3:56 pm

    Linux will not honor the suid bit on a shell script. Read this for more information.

    A common solution for this is the sudo command. With an entry like this in /etc/sudoers:

    yourname ALL = NOPASSWD:/path/to/graceful-restart
    

    You could run:

    sudo /path/to/graceful-restart
    

    And this would run with root privileges without prompting you for a password. See the sudoers man page for more information on the syntax of the sudoers file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any possibility to extract globalize2 translation for specified locale without setting I18n.locale
is there any possibility to perform conditional validation in authlogic's model User, that uses
Is there any possibility of having a button which will execute and action in
Is there any possibility of having same IMSI(International Mobile Subscriber Identity) number in two
Is there any possibility to select a option field by default in a g:select
Is there any possibility of changing the MySQL DB table's field name or adding
Is there any possibility to make a link or a button to close the
Is there any possibility in the prefix-function of a given pattern to have something
Is there any possibility of creating a view like the following image? I do
Is there any possibility using the drag&drop technology for dragging desktop images onto a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.