0

I am studying my listening services, and I am thinking how identify the type of git listening services so I can kill git the right one in the right situation and/or both. The services are needed for git push and git pull or git clone [repos], working also for a git server (DopeGhoti). Code where I do not understand what each listening service is doing

masi@masi:~$ netstat -lt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:git                   *:*                     LISTEN     
tcp6       0      0 [::]:git                [::]:*                  LISTEN     

Doing netstat -plnt but how to determine which belongs to Git A or B service

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:5348          0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:17991         0.0.0.0:*               LISTEN      24698/rsession  
tcp        0      0 0.0.0.0:9418            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:34893           0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:9999            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      -               
tcp6       0      0 :::9418                 :::*                    LISTEN      -               
tcp6       0      0 :::9999                 :::*                    LISTEN      -               
tcp6       0      0 :::111                  :::*                    LISTEN      -               
tcp6       0      0 :::80                   :::*                    LISTEN      -               
tcp6       0      0 :::33875                :::*                    LISTEN      -               
tcp6       0      0 ::1:631                 :::*                    LISTEN      -               
tcp6       0      0 ::1:5432                :::*                    LISTEN      -               
tcp6       0      0 ::1:25                  :::*                    LISTEN      -   

OS: Debian 8.7
Git: 2.1.4

1
  • Downvoter! Please, leave a feedback. - Iterating for clarity is not a caveat. Jun 23, 2017 at 6:46

1 Answer 1

2

"So many of them?" It's using precisely one, albeit on both the IPv4 and IPv6 interfaces.

Any service needs to be listening (or have a service aggregator such as xinetd listen by proxy) to some port or socket in order for incoming connections to be accepted.

In /etc/services, you can see git's port, 9418:

git             9418/tcp                        # Git Version Control System
4
  • 2
    For remote users to git push their code to, git pull code from, or git clone repositories from (et cetera); keep in mind that a git server is distinct from a git repository.
    – DopeGhoti
    Jun 19, 2017 at 22:47
  • 2
    Use netstat -plnt which will give you a numeric port as well as identify the listening process.
    – DopeGhoti
    Jun 20, 2017 at 15:21
  • 1
    git is defined in /etc/services as running its service on TCP port 9418.
    – DopeGhoti
    Jun 28, 2017 at 16:02
  • 2
    @LéoLéopoldHertz준영 /etc/services is just a mapping between standard service names and numbers. It gives no information about what services are actually in use--there is no point in "commenting out" lines in /etc/services Jun 28, 2017 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .