ubuntu-users Digest, Vol 141, Issue 20

Frank Chang frankchang91 at gmail.com
Sat May 14 01:52:20 UTC 2016


Hi Alejandro,
   Thank you for your excellent reply. Our architect told
me today that "we will not have an Ubuntu Linux terminal to run when
running in
mono-service mode. Instead we need to start an Ubuntu Linux service".
As a result, he does not want me to use export LD_LIBRARY_PATH
before mono-service ./AudioRecorder.exe.
   Furthermore, I cannot pass in LD_LIBRARY_PATH as a
command line argument because specifyiing LD_LIBRARY_PATH
as a command-line argument has no effect because
LD_LIBRARY_PATH is processed by the dynamic link loader (ld.so),
except in the case where the program calls after dlopen to load a plugin.
   Also, I looked at using -Wl, -rpath and $ORIGIN , according to
http://stackoverflow.com/questions/25918462/why-ld-library-path-is-bad-and-the-correct-way-to-load-dynamic-libraries,
to specify the directory path to the application and build a relative rpath
from there. You would then move the library to a known relative path to the
binary. In my humble opinion, this approach as
good as it is, has no analogue in  the C# .NET world. I
was wondering if there is a way to specify -rpath and $ORIGIN in the
C# .NET domain.
   I would think there might be a way when we start a LINUX service
to specify the LD_LIBRARY_PATH or any other UNIX environment
variable without using terminal macros(?sp)? My English is not that good.
    Thank you very much.

On Fri, May 13, 2016 at 8:09 PM, <ubuntu-users-request at lists.ubuntu.com>
wrote:

> Send ubuntu-users mailing list submissions to
>         ubuntu-users at lists.ubuntu.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> or, via email, send a message with subject or body 'help' to
>         ubuntu-users-request at lists.ubuntu.com
>
> You can reach the person managing the list at
>         ubuntu-users-owner at lists.ubuntu.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ubuntu-users digest..."
>
>
> Today's Topics:
>
>    1. Re: How to restart the networking after changing the network
>       configuration? (Tom H)
>    2. Re: How to restart the networking after changing the network
>       configuration? (Tom H)
>    3. Re: How to restart the networking after changing the network
>       configuration? (Tom H)
>    4. How do we do programmatically set LD_LIBRARY_PATH for this
>       scenario ,  mono-service ./AudioRecorder.exe where we are running
>       on Ubuntu Linux 14.06 and AudioRecorder.exe is a C# .NET
>       executable. (Frank Chang)
>    5. Re: How do we do programmatically set LD_LIBRARY_PATH for
>       this scenario , mono-service ./AudioRecorder.exe where we are
>       running on Ubuntu Linux 14.06 and AudioRecorder.exe is a C# .NET
>       executable. (Alejandro Visiedo Garc?a)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 13 May 2016 23:59:42 +0200
> From: Tom H <tomh0665 at gmail.com>
> To: Ubuntu Users <ubuntu-users at lists.ubuntu.com>
> Subject: Re: How to restart the networking after changing the network
>         configuration?
> Message-ID:
>         <CAOdo=
> Sxd0a+hDU2Y4czur1tN-Tjcx8wtdn-tN1ypWdFVuM1i1g at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Fri, May 13, 2016 at 3:15 PM, Zhengyu Guo <zhengyuguobuaa at gmail.com>
> wrote:
> >
> > My question is how to restart the networking after changing the network
> > configuration?
> >
> > I setup a bridge in my machine and I need to restart the network to make
> it
> > work. However, If I use the following command it will not work.
> >
> > ~~~
> > /etc/network$ sudo service networking restart
> > Job for networking.service failed because the control process exited with
> > error code. See "systemctl status networking.service" and "journalctl
> -xe"
> > for details.
> > ~~~
> > But if I reboot the machine, the configuration will take effect without
> any
> > problem.
> >
> > Therefore, I want to know if there are any alternative way that I can use
> > for restart the networking without the need for rebooting.
>
> ifdown <physical_nic>
>
> change "/etc/network/interfaces"
>
> ifup <bridge>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 14 May 2016 00:03:22 +0200
> From: Tom H <tomh0665 at gmail.com>
> To: Ubuntu Users <ubuntu-users at lists.ubuntu.com>
> Subject: Re: How to restart the networking after changing the network
>         configuration?
> Message-ID:
>         <CAOdo=
> SxT_B7ZjFXfX1qZ9VcOr3nH7LG+dwi7NxhDHAt5McgFCA at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Fri, May 13, 2016 at 3:51 PM, Stephen P. Molnar
> <s.molnar at sbcglobal.net>> wrote:
> >
> > as root dhclient eth0
> >
> > ------ Original Message ------
> > From: "Zhengyu Guo" <zhengyuguobuaa at gmail.com>>
> > To: ubuntu-users at lists.ubuntu.com
> > Sent: 5/13/2016 9:15:22 AM
> > Subject: How to restart the networking after changing the network
> > configuration?
> >>
> >> My question is how to restart the networking after changing the network
> >> configuration?
> >>
> >> I setup a bridge in my machine and I need to restart the network to
> make it
> >> work. However, If I use the following command it will not work.
> >>
> >> ~~~
> >> /etc/network$ sudo service networking restart
> >> Job for networking.service failed because the control process exited
> with
> >> error code. See "systemctl status networking.service" and "journalctl
> -xe"
> >> for details.
> >> ~~~
> >> But if I reboot the machine, the configuration will take effect without
> any
> >> problem.
> >>
> >> Therefore, I want to know if there are any alternative way that I can
> use
> >> for restart the networking without the need for rebooting.
>
> If you're using dhcp and not using "/etc/network/interfaces", you'd
> have to run "dhclient -r <physical_nic>", set up the bridge manually,
> "dhclient <bridge>".
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 14 May 2016 00:12:50 +0200
> From: Tom H <tomh0665 at gmail.com>
> To: Ubuntu Users <ubuntu-users at lists.ubuntu.com>
> Subject: Re: How to restart the networking after changing the network
>         configuration?
> Message-ID:
>         <CAOdo=SxW9ePpgm=
> AuDDqBi0kR9DZnBAMQZ4VnAo3YdRzKdWmQQ at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Fri, May 13, 2016 at 5:19 PM, Zhengyu Guo <zhengyuguobuaa at gmail.com>
> wrote:
> >
> > auto eth0
> > iface eth0 inet manual
> >
> > auto br0
> > iface br0 inet static
> > address xxx.xxx.xxx.xxx
> > network xxx.xxx.xxx.xxx
> > netmask xxx.xxx.xxx.xxx
> > broadcast xxx.xxx.xxx.xxx
> > gateway xxx.xxx.xxx.xxx
> > bridge_ports eth0
> > bridge_stp off
> > bridge_fd 0
> > bridge_maxwait 0
>
> You don't need to define eth0 in "/etc/network/interfaces".
>
> >From "man bridge-utils-interfaces":
>
> ---->
> The main extension is the bridge_ports option, with it you describe that
> the interface is a bridge and what ports does it have. These ports are
> the interfaces that are part of the bridge, and they shouldn't have any
> stanzas defining them on the interfaces file.
> <----
>
> Please don't top-post.
>
> >From https://community.ubuntu.com/contribute/support/mailinglists/ :
>
> "Write your email underneath the email which you are replying to."
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 13 May 2016 16:37:57 -0700
> From: Frank Chang <frankchang91 at gmail.com>
> To: ubuntu-users at lists.ubuntu.com
> Subject: How do we do programmatically set LD_LIBRARY_PATH for this
>         scenario ,  mono-service ./AudioRecorder.exe where we are running
> on
>         Ubuntu Linux 14.06 and AudioRecorder.exe is a C# .NET executable.
> Message-ID:
>         <
> CANuJMRqrTpwb_oarqUJBm9cSL2vugbZVnZPNEmJdHZWDKAPo4A at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> How do we do programmatically set LD_LIBRARY_PATH for this scenario?
>
> mono-service ./AudioRecorder.exe
>
> where we are running on Ubuntu Linux 14.06 and AudioRecorder.exe is a C#
> .NET executable. AudioRecorder.exe requires a shared object named
> libaudiocontrol.so to perform its duties. This shared object has to be
> found in the LD_LIBRARY_PATH location.
>
> We will not have an Ubuntu Linux terminal to run when running in
> mono-service mode. Instead we need to start an Ubuntu Linux service as
> shown below:
>
> Auto-start Checklist for Upstart
>
> This section is a quick reference to make sure your service is set to
> automatically start.
>
> Configuration Checklist
>
> Make sure the service has a functional Upstart init script located at
> /etc/init/service.conf
>     The /etc/init/service.conf file should contain a line like start
> on runlevel [2345] to enable automatic starting after a reboot
>     The /etc/init/service.conf file should also contain a line like
> respawn to enable the service to respawn after a crash
> Make sure there is no override file for the service:
> /etc/init/service.override
>
> (There would be one only if you or another admin made one earlier)
>
> Stop, then start, the service:
>
>   sudo initctl stop service
>   sudo initctl start service
>
> Reboot the server.
>
>   sudo reboot
>
> Here is another way make sure your service is set to automatically start.
>
> Auto-start Checklist for systemd
>
> This section is a quick reference to make sure your service is set to
> automatically start.
>
> Configuration Checklist
>
> Make sure the service has a functional systemd init script located at
> /etc/systemd/system/multi-user.target.wants/service.service
> Use the systemctl command to enable the service:
>
>   sudo systemctl enable service.service
>
> This should create a symlink in
> /etc/systemd/system/multi-user.target.wants/ that looks like the
> following (do NOT create this manually):
>
> lrwxrwxrwx 1 root root 38 Aug 1 04:43
> /etc/systemd/system/multi-user.target.wants/service.service ->
> /usr/lib/systemd/system/service.service
>
> This will enable automatic starting after a reboot.
>
> The /etc/systemd/system/multi-user.target.wants/service.service file
> should also contain a line like Restart=always under the [Service]
> section of the file to enable the service to respawn after a crash
> Reload the systemd daemon, followed by a restart of the service:
>
>   sudo systemctl daemon-reload
>   sudo systemctl restart service.service
>
> I read in this URL:
>
>
> http://stackoverflow.com/questions/10963498/mono-shared-library-under-linux-location
> that you have to: LD_LIBRARY_PATH=. mono yourapp.exe. How might I do that
> for a Linux service?
>
> I also read Why change in LD_LIBRARY_PATH at Runtime dosen't Reflect on the
> Executable once the Executable gets loaded
> <
> http://stackoverflow.com/questions/19337926/why-change-in-ld-library-path-at-runtime-dosent-reflect-on-the-executable-once
> >
> .
>
> Could some expert comment on this URL and suggest a potential solution?
>
> Any help is greatly appreciated.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.ubuntu.com/archives/ubuntu-users/attachments/20160513/c6b4215b/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 5
> Date: Fri, 13 May 2016 19:09:35 -0500
> From: Alejandro Visiedo Garc?a <alejandro.visiedo at gmail.com>
> To: "Ubuntu user technical support, not for general discussions"
>         <ubuntu-users at lists.ubuntu.com>
> Subject: Re: How do we do programmatically set LD_LIBRARY_PATH for
>         this scenario , mono-service ./AudioRecorder.exe where we are
> running
>         on Ubuntu Linux 14.06 and AudioRecorder.exe is a C# .NET
> executable.
> Message-ID: <5C655F97-F3A7-41FC-85E8-5DF28EE94EBD at gmail.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Change the program to execute for a script! Into the script export
> LD_LIBRARY_PATH to add the path of the library and then launch the
> executable file at the end of the script with the params received to the
> script!
>
> Regards!
>
> > On 13 May 2016, at 18:37, Frank Chang <frankchang91 at gmail.com> wrote:
> >
> > How do we do programmatically set LD_LIBRARY_PATH for this scenario?
> >
> > mono-service ./AudioRecorder.exe
> > where we are running on Ubuntu Linux 14.06 and AudioRecorder.exe is a C#
> .NET executable. AudioRecorder.exe requires a shared object named
> libaudiocontrol.so to perform its duties. This shared object has to be
> found in the LD_LIBRARY_PATH location.
> >
> > We will not have an Ubuntu Linux terminal to run when running in
> mono-service mode. Instead we need to start an Ubuntu Linux service as
> shown below:
> >
> > Auto-start Checklist for Upstart
> >
> > This section is a quick reference to make sure your service is set to
> automatically start.
> >
> > Configuration Checklist
> >
> > Make sure the service has a functional Upstart init script located at
> /etc/init/service.conf
> >     The /etc/init/service.conf file should contain a line like start on
> runlevel [2345] to enable automatic starting after a reboot
> >     The /etc/init/service.conf file should also contain a line like
> respawn to enable the service to respawn after a crash
> > Make sure there is no override file for the service:
> /etc/init/service.override
> > (There would be one only if you or another admin made one earlier)
> >
> > Stop, then start, the service:
> >
> >   sudo initctl stop service
> >   sudo initctl start service
> >
> > Reboot the server.
> >
> >   sudo reboot
> > Here is another way make sure your service is set to automatically start.
> >
> > Auto-start Checklist for systemd
> >
> > This section is a quick reference to make sure your service is set to
> automatically start.
> >
> > Configuration Checklist
> >
> > Make sure the service has a functional systemd init script located at
> /etc/systemd/system/multi-user.target.wants/service.service
> > Use the systemctl command to enable the service:
> >
> >   sudo systemctl enable service.service
> >
> > This should create a symlink in
> /etc/systemd/system/multi-user.target.wants/ that looks like the following
> (do NOT create this manually):
> > lrwxrwxrwx 1 root root 38 Aug 1 04:43
> /etc/systemd/system/multi-user.target.wants/service.service ->
> /usr/lib/systemd/system/service.service
> >
> > This will enable automatic starting after a reboot.
> >
> > The /etc/systemd/system/multi-user.target.wants/service.service file
> should also contain a line like Restart=always under the [Service] section
> of the file to enable the service to respawn after a crash
> > Reload the systemd daemon, followed by a restart of the service:
> >
> >   sudo systemctl daemon-reload
> >   sudo systemctl restart service.service
> > I read in this URL:
> >
> >
> http://stackoverflow.com/questions/10963498/mono-shared-library-under-linux-location
> that you have to: LD_LIBRARY_PATH=. mono yourapp.exe. How might I do that
> for a Linux service?
> >
> > I also read Why change in LD_LIBRARY_PATH at Runtime dosen't Reflect on
> the Executable once the Executable gets loaded.
> >
> > Could some expert comment on this URL and suggest a potential solution?
> >
> > Any help is greatly appreciated.
> >
> > --
> > ubuntu-users mailing list
> > ubuntu-users at lists.ubuntu.com
> > Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.ubuntu.com/archives/ubuntu-users/attachments/20160513/587b914b/attachment.html
> >
>
> ------------------------------
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
> End of ubuntu-users Digest, Vol 141, Issue 20
> *********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20160513/ad8b330b/attachment.html>


More information about the ubuntu-users mailing list