我有一個C程序需要運行時,當我打開我的機器(紅火龍果)。 節目的開頭這裏介紹:在啓動時運行C程序[Red Pitaya]
//my_test program
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "redpitaya/rp.h"
int main(int argc, char **argv){
int jj=1;
while(1) {
printf("Ready for experiment number %i\n",jj);
int i, D;
int32_t TrigDly;
等等...
程序是可執行文件稱爲uri_test.sh
一個run.sh文件,包含以下內容:
cat /opt/redpitaya/fpga/fpga_0.94.bit>/dev/xdevcfg
LD_LIBRARY_PATH=/opt/redpitaya/lib ./my_test
這兩個文件都位於/ root下的目錄中。 PuTTY的手動運行時程序完美的工作端 -
/RedPitaya/Examples/C/Uri# ./my_test
或
/RedPitaya/Examples/C/Uri# ./uri_test.sh
我試圖按照這裏的解決方案提出:
https://askubuntu.com/questions/9853/how-can-i-make-rc-local-run-on-startup
沒有成功。 有什麼建議嗎?謝謝。
C? C#?也不是腳本。或者神祕的#C是? –
你應該在你的問題中顯示腳本。我不會調用C或C#源文件的腳本(並且還需要顯示編譯它的精確程度)。所以**編輯你的問題**(源代碼行需要前綴四個空格)來改善它很多 –
這個問題與[tag:c]無關,這是一個ubuntu的具體問題。請閱讀[systemd services](http://www.devdungeon.com/content/creating-systemd-service-files)。此外,沒有[tag:c]腳本,[tag:c]是一種編譯語言。原則上,「* startup *」程序可以是任何可執行文件,無論是shell腳本還是編譯後的c程序。另外,C#如果你的意思是Windows特定的語言,它可以在Linux AFAIK上工作,但在Linux上看到C#程序並不常見。 –