La commande 'chsubserver' permet d'effectuer des modifications dans le fichier '/etc/inetd.conf'.
Les syntaxes sont les suivantes, suivant l'opération souhaitée :
Pour ajouter, activer un service ou une entrée de sous-système :
chsubserver [ -a ] -v ServiceName -p protocol [ -t socket_type ][ -w WaitIndicator ] [ -u user ] [ -g program ] [ -r server ] [ -CConfigFile ] [ program ] [ args ]
POur changer une entrée existante :
chsubserver -c -v ServiceName -p protocol [ -t SocketType ] [ -w WaitIndicator ] [ -u user ] [ -g program ] [ -VNewServiceName ] [ -P NewProtocol ] [ -T NewSocketType ] [ -W NewWaitIndicator ] [ -U NewUser ] [ -G NewProgram ] [ -rserver ] [ -C ConfigFile ] [ program ] [ args ]
Pour désactiver une entrée de services ou de sous-système:
chsubserver -d -v ServiceName -p protocol [ -t SocketType ] [ -w WaitIndicator ] [ -u user ] [ -g program ] [ -r server ] [ -CConfigFile ] [ program ] [ args ]
Exemples
- Pour décommenter la ligne concernant UUCP dans le fichier /etc/inetd.conf file, entrer:
chsubserver -a -v uucp -p tcp
- Pour ajouter une ligne dans /etc/inetd.conf qui décrit le service 'gregserv' et lance le proramme/usr/sbin/gregserv sous le compte 'root' à l'aide du protocole UDP avec connecteurs Stream et comme arguments ftpd, entrer la ligne suivante:
Le processus INETD n'attend pas de confirmation. Aussi, après ajout de la ligne, le programm envoie un signal SIGHUP.chsubserver -a -r inetd -v gregserv -p udp -t stream -w nowait -u \ root -g /usr/sbin/gregserv ftpd
- Pour modifier un service existante pour qu'il passe d'une utilisation 'stream' à une utilisation 'dgram', entrer :
chsubserver -c -v gregserv -p udp -t stream -T dgram -C /tmp/inetd.conf
- Pour mettre en commentaire le service 'gregserv' en protocole UDP, entrer:
chsubserver -d -v gregserv -p udp
Ci-dessous la fiche AIX V6.1 de la commande :
chsubserver Command
Purpose
Changes the contents of the /etc/inetd.conf file or similar system configuration file.
Syntax
To Add or Activate a Server or Subserver Entry:
chsubserver [ -a ] -v ServiceName -p protocol [ -t socket_type ][ -w WaitIndicator ] [ -u user ] [ -g program ] [ -r server ] [ -C ConfigFile ] [program ] [ args ]
To Change a Server Entry:
chsubserver -c -v ServiceName -p protocol [ -t SocketType ] [ -w WaitIndicator ] [ -u user ] [ -g program ] [ -V NewServiceName ] [ -PNewProtocol ] [ -T NewSocketType ] [ -W NewWaitIndicator ] [ -U NewUser ] [ -G NewProgram ] [ -r server ] [ -C ConfigFile ] [ program ] [args ]
To Deactivate a Server Entry or an inetd Subserver Entry:
chsubserver -d -v ServiceName -p protocol [ -t SocketType ] [ -w WaitIndicator ] [ -u user ] [ -g program ] [ -r server ] [ -C ConfigFile ] [program ] [ args ]
Description
The chsubserver command adds, deletes, or changes entries in the /etc/inetd.conf system configuration file, which is the default, or a similar configuration file. These entries are related to known services used in the DARPA Internet and also related to information used by the inetd server. The entries for the inetd server determine how the system handles Internet service requests.
The chsubserver command also allows the user to refresh a server using the -r flag. The server specified is sent a SIGHUP signal to reread its configuration file. This allows you to edit the configuration file and have the changes take effect immediately.
Each service entry contains information about known services and information used by the inetd server. The chsubserver command manipulates the following entries for known services and for inetd server or other subserver information:
- The official Internet service name specified by the ServiceName variable.
- The transport protocol, specified by the protocol variable, used for the service.
- The type of socket, specified by the SocketType variable, associated with the service. The socket types associated with a service can be stream sockets or datagram sockets. Use only the nowait flag with stream sockets. Use either the wait or nowait flag with datagram sockets.
- A wait or nowait flag, specified by the WaitIndicator variable. The wait or nowait flag indicates whether the inetd server waits for a datagram server to release the socket before continuing to listen at the socket.
- The user name, specified by the user variable, that the inetd server uses to start a subserver.
You can use the System application in Web-based System Manager (wsm) to change system characteristics. You could also use the System Management Interface Tool (SMIT) smit inetdconf fast path to run this command.
Flags
Item | Description |
---|---|
-a | Adds or activates an entry in the configuration file. If the requested service exists in the configuration file, the -a flag uncomments the line. If the line does not exist, the -a flag adds the line to the configuration file. This is the default action. |
-c | Changes an entry in the configuration file. |
-C | Specifies a configuration file similar to /etc/inetd.conf. |
-d | Deactivates an entry in the configuration file by commenting the line in the file. |
-G NewProgram | Replaces the existing program to start. |
-g Program | Specifies the program to start.. |
-P NewProtocol | Specifies a new protocol name for a current protocol name. |
-p protocol | Specifies the protocol. |
-r server | Sends a SIGHUP to the specified server. |
-T NewSocketType | Replaces the existing type of socket, either a value of stream for stream sockets or a value ofdgram for datagram sockets. |
-t SocketType | Specifies a type of socket, either a value of stream for stream sockets or a value of dgram for datagram sockets. |
-U NewUser | Replaces the existing user name. |
-u user | Specifies a user name. |
-V NewName | Specifies a new service name. |
-v ServiceName | Specifies the service name. |
-W NewWaitIndicator | Replaces the existing WaitIndicator. |
-w WaitIndicator | Specifies either single-thread service with a value of wait or multithread service with a value ofnowait. |
Security
Access Control: Only the root user and members of the system group have access to this command.
Examples
- To uncomment the uucp line in the /etc/inetd.conf file, enter:
chsubserver -a -v uucp -p tcp
- To add a line to the /etc/inetd.conf file that describes the gregserv service and runs the program /usr/sbin/gregserv as root over the udp protocol with stream sockets and arguments of ftpd, enter in one line:
The inetd does not wait for confirmation. After adding the line to the file, the inetd program will be sent a SIGHUP signal.chsubserver -a -r inetd -v gregserv -p udp -t stream -w nowait -u root -g /usr/sbin/gregserv ftpd
- To change the existing service from using stream sockets to using dgram sockets in the /tmp/inetd.conf file, enter in one line:
chsubserver -c -v gregserv -p udp -t stream -T dgram -C /tmp/inetd.conf
- To comment the gregserv service over udp in the /etc/inetd.conf file, enter:
chsubserver -d -v gregserv -p udp
Files
Item | Description |
---|---|
/usr/sbin/chsubserver | Contains the chsubserver command. |
/etc/inetd.conf | Contains configuration information for the inetddaemon. |