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

  • SEARCH
  • Home
  • 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 8394607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:06:14+00:00 2026-06-09T20:06:14+00:00

I thought that this should be straightforward, but the result is puzzling me. When

  • 0

I thought that this should be straightforward, but the result is puzzling me.

When I run a bash script using the command,

sudo ./restartccpd.bash

nothing appears on the screen. Also issue of

sudo /etc/init.d/ccpd status

independently from screen after running the script produces empty, rather than showing the pid’s of the daemon. This evidences that only the pkill command is working.

The contents of the script is,

#!/bin/bash

sudo pkill -9 ccpd
sudo /etc/init.d/ccpd start
sudo /etc/init.d/ccpd status

The commands work fine when run from a terminal. But when run as a script, as pointed out above, it is not working as expected.

I tried inserting sleep command between commands, without any avail. Also, nothing appears in syslog. So, I can not diagnose the problem.

Any suggestion will be appreciated.

  • 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-09T20:06:15+00:00Added an answer on June 9, 2026 at 8:06 pm

    pkill will kill anything contained ccpd in the command name. Your script is called restartccpd.bash. The very first line is:

    pkill ccpd
    

    So the script starts, runs pkill (which produces no output) and promptly kills itself. Ta da!

    The easiest solution is to rename the script. You could also do something like:

    kill $(pgrep -l ccpd | grep -v restartccpd | awk '{print $1}')
    

    This produces a list of proccess names and pids matching ccpd, then removes restartccpd from the list, and then kills the processes with kill.

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

Sidebar

Related Questions

Should be an easy one. I thought, from reading this blog post that I
I would have thought that this would be an easy thing to do, but
I'm trying to do something that I think should be pretty straightforward but I
I thought that this was easier… I have a asp:hyperlink control, with target=_blank ,
I thought that I improve performance when I replace this code: def f(a, b):
When this quick one hour project came up I never thought that 2 days
After I thought that I've understood how they work, I tried this: NSString *str1
I always thought that *&p = p = &*p in C. I tried this
I came across this code on reddit . I would have thought that type
This comment confuses me: kill -l generally lists all signals. I thought that 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.