Top
PRIMECLUSTER Global Disk Services  Configuration and AdministrationGuide 4.3
FUJITSU Software

6.9 Volume's Block Special File Access Permission

The block special file /dev/sfdsk/Class_Name/dsk/Volume_Name of the volume is created when a volume is created and re-created every time the node is rebooted.

The volume's block special file access permission is set as follows.

To change the access permission, configure the following setting.

Descriptions in the Startup Script for Access Permission Setting

An example of script description for RHEL is shown below.

#!/bin/bash

# chkconfig: 2345 54 61                                           ... (1)
# description: chgperm - change GDS volume permission             ... (2)

. /etc/init.d/functions

start() {
    /bin/chown gdsusr:gdsgrp /dev/sfdsk/Class1/dsk/Volume1        ... (3)
    /bin/chmod 0644 /dev/sfdsk/Class1/dsk/Volume1                 ... (3)
    return
}

stop() {
    return
}

case "$1" in
    start)
        start
    ;;
    stop)
        stop
    ;;
    restart)
        stop
        start
    ;;
    *)
        echo "Usage: /etc/init.d/chgperm {start|stop|restart}"    ... (4)
    ;;
esac
exit 0

When using RHEL5 or later, at GDS installation, a sample of this startup script is installed to /etc/opt/FJSVsdx/etc/chgperm.sample. Copy and customize this sample before using it.

Explanation of the Descriptions:

(1)

This is the entry required for RHEL6 or earlier.
To the right of "# chkconfig:," describe the run level of this startup script, the start priority, and the stop priority.
This script must be executed after the GDS startup script. Therefore, for the start priority, 54 or a greater value must be set.
Do not describe this entry for RHEL7 or later.

(2)

To the right of "description:," give a description of this startup script.

(3)

Describe commands executed at node startup.
The commands shown in this example set the owner to gdsusr, the group to gdsgrp, and the mode to 0644 with respect to the block special file of Volume1 in Class1.

(4)

Describe the process to show the usage of this startup script.
The startup script name in this example is chgperm.

See

  • For details on (1) and (2), see chkconfig(8).

  • For details on the commands to set the file access permission, see chown(1) and chmod(1).

Descriptions of the unit file (RHEL7 or later)

See the example below.

[Unit]
Description=change GDS volume permission             ...(1)
After=fjsvsdxmon.service                               ...(2)

[Service]
ExecStart=/bin/bash -c '/home/bin/chgperm start'    ...(3)
Type=oneshot

[Install]
WantedBy=multi-user.target

Explanation of the Descriptions:

(1)

To the right of Description=, describe the description of this unit file.

(2)

Describe the script to be started later then the GDS service "fjsvsdxmon.service."

(3)

Describe the start script that changes the access permission (/home/bin/chgperm in this example).


How to Set the Startup Script for Access Permission Setting

(a) For RHEL6 or earlier

Take the following steps to set the startup script.

  1. Locate the startup script to the path /etc/rc.d/init.d/Script Name.

  2. Execute the following command to register the startup script.

    # chkconfig --add Script Name

    Information

    When the command shown in 2. is executed, the following symbolic link files are generated.

    /etc/rc.d/rcRun Level.d/SStart Priority Script Name
    /etc/rc.d/rcRun Level.d/KStop Priority Script Name

    See

    For details on the startup script, see chkconfig(8).

(b) For RHEL7 or later

Configure the following setting.

  1. Locate the unit file in the path /usr/lib/systemd/system/unit_file_name.

  2. Execute the following command to enable the service.

    # /usr/bin/systemctl enable unit_file_name

    Information

    By executing the command in the above procedure 2, the following symbolic link file is created.

    /etc/systemd/system/multi-user.target.wants/unit_file_name