0
0
Fork 0
zblog/content/post/71.md

21 lines
737 B
Markdown
Raw Normal View History

+++
title = "set environment variables in smf manifests"
date = "2011-09-26T14:35:10+00:00"
author = "Gibheer"
draft = false
+++
If you are in the need to set an environment variable for an smf service, you are looking for envvar. It get's set in the `service` scope or in the `exec_method` scope. Here is a small example, how it's used.
```
<exec_method type="method" name="start" exec="/bin/bash">
<method_context>
<method_environment>
<envvar name="FOO" value="bar" />
</method_environment>
</method_context>
</exec_method>
```
This example sets the environment variable `FOO` to bar. This is espacially useful, when you have to modify `PATH` or `LD_LIBRARY_PATH`. Just don't forget, that you did it.