Results 1 to 4 of 4

Thread: How to add the old run "service" to kali sana or rolling

  1. #1
    Join Date
    2014-Mar
    Posts
    163

    How to add the old run "service" to kali sana or rolling

    For those that came from kali wheezy and miss the command:
    ex : "service network-manager start" that changed in kali jessie to "/etc/init.d/network-manager start"
    all you have to do to add this old command to your kali is create a script in your "/usr/bin" with the name :

    service

    and add this bash code to it :

    #!/bin/bash
    cmd=$1
    run=$2
    /etc/init.d/$cmd $run
    exit
    then add execution permissions to this script by typing :

    chmod +x /usr/bin/service

    and its done .

    Now you can stop , restart or run your linux services like it was before by typing :

    service nginx start

    or any other service in /etc/init.d/ directory .

    Last none :
    On a migration from wheezy to jessie (moto ->jessie) kali , you will have a filename with the name "service" on your "/usr/sbin" folder that will be not used anymore .

    rename that file , so the terminal console does not give priority to it instead the new file .

    mv /usr/sbin/service /usr/sbin/service.bak
    then close your terminal and open it again and it should work perfectly
    Last edited by pedropt; 2016-12-29 at 21:52.

  2. #2
    Join Date
    2014-Feb
    Posts
    309
    Instead of creating this random file....

    Either do it as an alias in your ~/.bashrc ; or (ideally) learn the new way which is using systemctl (which is good because init scripts are going away slowly).

    so instead of service servicename start you do systemctl start servicename

  3. #3
    Join Date
    2014-Mar
    Posts
    163
    For that you just need to change the script to :

    #!/bin/bash
    cmd=$1
    run=$2
    systemctl $cmd $run
    exit
    and instead using "service network-manager start" , you must use "service start network-manager" , but that defies the main objective of this script originally and it makes no sense using "service" instead "systemctl".

    I did this script particularly for those that came from wheezy to jessie , and not for those that the first time they saw kali was on 2.0 version , because those are already use to "systemctl" command .

  4. #4
    Join Date
    2013-Jul
    Posts
    844
    The service command for network-manager in kali-linux R2 accepts:

    service NetworkManager start as well as service network-manager start

    We are unsure if kali-linux sana accepts service network-manager start

    MTeams only noticed this during a program audit of airmon-ng especially the airmon-ng check kill comand.

    As a side note we still think that if you evoke airmon-ng check kill and then try and restore network-manager later with service NetworkManager start then some parts of network-manager do not function. This is because airmon-ng check kill also evokes service avahi-daemon stop. See line 997 in /usr/sbin/airmon-ng


    Musket Teams
    Last edited by mmusket33; 2017-01-02 at 08:16.

Similar Threads

  1. Build-script error ARM RADXA ZERO - "unit ssh.service does not exist"
    By m21 in forum Building Custom Kali Images
    Replies: 0
    Last Post: 2023-06-23, 10:40
  2. Replies: 3
    Last Post: 2023-01-28, 18:29
  3. Kali 2.0 SANA "Ralink Technology, Corp. MT7601U" USB wifi not working
    By k.v.manjunath in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2016-01-19, 15:03
  4. how to delete ubuntu and instal kali sana without crash "grub"
    By debian-k in forum Installing Archive
    Replies: 1
    Last Post: 2015-10-04, 09:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •