Top
PRIMECLUSTER Global Disk Services  Configuration and AdministrationGuide 4.6
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.

When changing the access permission, create a startup script in which the command that changes the access permission is described, and create a unit file that executes the startup script so that the script is executed later than all of the GDS services (fjsvsdx*.service).

See

For details about GDS services, see "F.2 systemd Service Lists."


Descriptions in the Startup Script for Access Permission Setting

An example of script description for RHEL is shown below.

#!/bin/bash

# description: chgperm - change GDS volume permission             ...(1)

. /etc/init.d/functions

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

stop() {
    return
}

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

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)

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

(2)

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.

(3)

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), 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

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

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