Esmith::Build::CreateLinks

From SME Server
Revision as of 22:23, 21 December 2013 by Stephdl (talk | contribs) (→‎AUTHOR)
Jump to navigation Jump to search
PythonIcon.png Skill level: Developer
Risk of inconsistencies with Koozali SME Server methodology, upgrades & functionality is high. One must be knowledgeable about how changes impact their Koozali SME Server. Significant risk of irreversible harm.


NAME

esmith::Build::CreateLinks - A library for creating symlinks during rpm construction.

In a root terminal you can do the command below if you want to display the up-to-date content

perldoc esmith::Build::CreateLinks

SYNOPSIS

use esmith::Build::CreateLinks qw(:all);
safe_symlink("../../../functions/$function", "$cgibin/$function")

DESCRIPTION

safe_symlink

This function works like symlink(), but if the directory being linked to does not exist, it will create it.

ie. safe_symlink("../../../functions/$function", "$cgibin/$function")

panel_link

This function creates a link to a web panel.

ie.

my $panel = "manager";
panel_link("tug", $panel);
admin_common_link

This function creates a symlink from the common manager directory to a file in the functions directory.

event_link

This function creates a symlink from an action’s ordered location in an event directory to its action script.

ie.

my $event = "tug-update";
event_link("tug-conf", $event, "10");
event_link("conf-masq", $event, "20");
event_link("adjust-masq", $event, "30");
event_link("tug-restart", $event, "40");
service_link_enhanced

This function creates a symlink from a SysV init start or kill link in a runlevel to e-smith-service, a wrapper that is config db aware.

ie.

safe_symlink("daemontools", "root/etc/rc.d/init.d/tug");
service_link_enhanced("tug", "S85", "7");
service_link_enhanced("tug", "K25", "6");
service_link_enhanced("tug", "K25", "0");
safe_touch

This function creates an empty file, but first creates any enclosing directories. For example:

safe_touch("a/b/c/d");

will create any of the directories "a", "a/b", "a/b/c" which don’t exist, then create an empty file "a/b/c/d".

templates2events

This function creates a file tree (of empty files) which is used by the generic_template_expand action to determine which templates need to be expanded for a particular event. Takes one file argument and a list of event names, e.g.

templates2events("/etc/some/file", "event1", "event2", ...);

AUTHOR

SME Server Developers <bugs@e-smith.com>